Remove columns that are no longer being used.

This commit is contained in:
Guo Xiang Tan 2017-06-05 10:59:05 +09:00
parent 18e598a3b0
commit 1c05ca91ea
2 changed files with 24 additions and 0 deletions

View File

@ -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!"
}
)

View File

@ -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