From 01a63f8b4b3d193ecf9d25a8f7a0365c2902f0aa Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 24 Jul 2018 15:18:57 +0800 Subject: [PATCH] Drop `EmailLogs#topic_id`. --- db/fixtures/000_delayed_drops.rb | 11 +++++++++++ .../20180724070554_drop_topic_id_on_email_logs.rb | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 db/migrate/20180724070554_drop_topic_id_on_email_logs.rb diff --git a/db/fixtures/000_delayed_drops.rb b/db/fixtures/000_delayed_drops.rb index 2cc74cc605d..edf88f772dd 100644 --- a/db/fixtures/000_delayed_drops.rb +++ b/db/fixtures/000_delayed_drops.rb @@ -239,4 +239,15 @@ Migration::ColumnDropper.drop( } ) +Migration::ColumnDropper.drop( + table: 'email_logs', + after_migration: 'DropTopicIdOnEmailLogs', + columns: %w{ + topic_id + }, + on_drop: ->() { + STDERR.puts "Removing superflous email_logs columns!" + } +) + Discourse.reset_active_record_cache diff --git a/db/migrate/20180724070554_drop_topic_id_on_email_logs.rb b/db/migrate/20180724070554_drop_topic_id_on_email_logs.rb new file mode 100644 index 00000000000..199c24bd431 --- /dev/null +++ b/db/migrate/20180724070554_drop_topic_id_on_email_logs.rb @@ -0,0 +1,5 @@ +class DropTopicIdOnEmailLogs < ActiveRecord::Migration[5.2] + def change + remove_index :email_logs, :topic_id + end +end