While I don't use this feature, there are developers who do. It's useful when running migrations and changing branches. I'm raising an `ActiveRecord::IrreversibleMigration` exception in every `drop_table` migration because these migrations were all done before version 1.0.0, and so making all of them reversible would be too much work for little benefit.
21 lines
676 B
Ruby
21 lines
676 B
Ruby
class RemovePollWhiteNullTotalResults < ActiveRecord::Migration[4.2]
|
|
def up
|
|
remove_index :poll_null_results, column: [:booth_assignment_id]
|
|
remove_index :poll_null_results, column: [:officer_assignment_id]
|
|
|
|
remove_index :poll_white_results, column: [:booth_assignment_id]
|
|
remove_index :poll_white_results, column: [:officer_assignment_id]
|
|
|
|
remove_index :poll_total_results, column: [:booth_assignment_id]
|
|
remove_index :poll_total_results, column: [:officer_assignment_id]
|
|
|
|
drop_table :poll_null_results
|
|
drop_table :poll_total_results
|
|
drop_table :poll_white_results
|
|
end
|
|
|
|
def down
|
|
fail ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|