Skip to content

Commit fdb908c

Browse files
authored
Merge pull request #2397 from codebar/add-missing-indexes
Add missing database indexes
2 parents 9ecd58b + 23e7e12 commit fdb908c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class AddMissingIndexes < ActiveRecord::Migration[6.0]
2+
def change
3+
add_index :invitations, :event_id unless index_exists?(:invitations, :event_id)
4+
add_index :invitations, :member_id unless index_exists?(:invitations, :member_id)
5+
add_index :workshop_invitations, :workshop_id unless index_exists?(:workshop_invitations, :workshop_id)
6+
add_index :workshop_invitations, :member_id unless index_exists?(:workshop_invitations, :member_id)
7+
add_index :events, :date_and_time unless index_exists?(:events, :date_and_time)
8+
add_index :workshops, :date_and_time unless index_exists?(:workshops, :date_and_time)
9+
end
10+
end

0 commit comments

Comments
 (0)