Make migrations using remove_index reversible
These issues were detected after upgrading to rubocop-rails >= 2.8.0.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class AddPollShiftTaskIndex < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_index "poll_shifts", name: "index_poll_shifts_on_booth_id_and_officer_id"
|
||||
remove_index "poll_shifts", column: [:booth_id, :officer_id]
|
||||
add_index :poll_shifts, :task
|
||||
add_index :poll_shifts, [:booth_id, :officer_id, :task], unique: true
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class RemoveOfficerAssigmentComposedIndex < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_index "poll_officer_assignments", name: "index_poll_officer_assignments_on_officer_id_and_date"
|
||||
remove_index "poll_officer_assignments", column: [:officer_id, :date]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class AddDateToPollShiftComposedIndex < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
remove_index "poll_shifts", name: "index_poll_shifts_on_booth_id_and_officer_id_and_task"
|
||||
remove_index "poll_shifts", name: "index_poll_shifts_on_task"
|
||||
remove_index "poll_shifts", column: [:booth_id, :officer_id, :task]
|
||||
remove_index "poll_shifts", :task
|
||||
add_index :poll_shifts, [:booth_id, :officer_id, :date, :task], unique: true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@ class AddConfigToDownloadSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :download_settings, :config, :integer, default: 0, null: false
|
||||
|
||||
remove_index :download_settings, name: "index_download_settings_on_name_model_and_name_field"
|
||||
remove_index :download_settings, column: [:name_model, :name_field]
|
||||
add_index :download_settings, [:name_model, :name_field, :config], unique: true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user