From 43f63c435d0098ffb0bc66c5544e026099818310 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Wed, 21 Mar 2018 12:07:47 +0100 Subject: [PATCH] FIX: Drop unused tables with a delay --- db/fixtures/999_delayed.rb | 16 ++++++++++++++++ db/migrate/20180227161818_drop_unused_tables.rb | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/db/fixtures/999_delayed.rb b/db/fixtures/999_delayed.rb index 6a7ea17e803..7b6d280db97 100644 --- a/db/fixtures/999_delayed.rb +++ b/db/fixtures/999_delayed.rb @@ -10,3 +10,19 @@ Migration::TableDropper.delayed_rename( 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." + } +) diff --git a/db/migrate/20180227161818_drop_unused_tables.rb b/db/migrate/20180227161818_drop_unused_tables.rb index 1db8c57d551..f0c735f0218 100644 --- a/db/migrate/20180227161818_drop_unused_tables.rb +++ b/db/migrate/20180227161818_drop_unused_tables.rb @@ -1,7 +1,6 @@ class DropUnusedTables < ActiveRecord::Migration[5.1] def up - drop_table :category_featured_users - drop_table :versions + # Delayed drop of tables "category_featured_users" and "versions" end def down