mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 17:52:45 +08:00
Merge pull request #4893 from tgxworld/remove_unused_columns
Remove columns that are no longer being used.
This commit is contained in:
commit
0ecb668d49
@ -95,3 +95,18 @@ ColumnDropper.drop(
|
||||
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…
x
Reference in New Issue
Block a user