Remove columns that are no longer being used.
This commit is contained in:
parent
18e598a3b0
commit
1c05ca91ea
|
@ -95,3 +95,18 @@ ColumnDropper.drop(
|
||||||
STDERR.puts "Removing superflous topic columns!"
|
STDERR.puts "Removing superflous topic columns!"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ColumnDropper.drop(
|
||||||
|
table: 'topics',
|
||||||
|
after_migration: 'RemoveAutoCloseColumnsFromTopics',
|
||||||
|
columns: %w{
|
||||||
|
auto_close_at
|
||||||
|
auto_close_user_id
|
||||||
|
auto_close_started_at
|
||||||
|
auto_close_based_on_last_post
|
||||||
|
auto_close_hours
|
||||||
|
},
|
||||||
|
on_drop: ->(){
|
||||||
|
STDERR.puts "Removing superflous topic columns!"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
class RemoveAutoCloseColumnsFromTopics < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
# Defer dropping of the columns until the new application code has been deployed.
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
raise ActiveRecord::IrreversibleMigration
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue