FIX: Drop unused tables with a delay

This commit is contained in:
Gerhard Schlager 2018-03-21 12:07:47 +01:00
parent d96c1058a2
commit 43f63c435d
2 changed files with 17 additions and 2 deletions

View File

@ -10,3 +10,19 @@ Migration::TableDropper.delayed_rename(
STDERR.puts "Dropping topic_status_updates. It was moved to topic_timers." STDERR.puts "Dropping topic_status_updates. It was moved to topic_timers."
} }
) )
Migration::TableDropper.delayed_drop(
table_name: 'category_featured_users',
after_migration: 'DropUnusedTables',
on_drop: ->() {
STDERR.puts "Dropping category_featured_users. It isn't used anymore."
}
)
Migration::TableDropper.delayed_drop(
table_name: 'versions',
after_migration: 'DropUnusedTables',
on_drop: ->() {
STDERR.puts "Dropping versions. It isn't used anymore."
}
)

View File

@ -1,7 +1,6 @@
class DropUnusedTables < ActiveRecord::Migration[5.1] class DropUnusedTables < ActiveRecord::Migration[5.1]
def up def up
drop_table :category_featured_users # Delayed drop of tables "category_featured_users" and "versions"
drop_table :versions
end end
def down def down