mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 16:29:32 +08:00
Drop reply_key
, skipped
and skipped_reason
from email_logs
.
This commit is contained in:
@ -241,9 +241,12 @@ Migration::ColumnDropper.drop(
|
||||
|
||||
Migration::ColumnDropper.drop(
|
||||
table: 'email_logs',
|
||||
after_migration: 'DropTopicIdOnEmailLogs',
|
||||
after_migration: 'DropReplyKeySkippedSkippedReasonFromEmailLogs',
|
||||
columns: %w{
|
||||
topic_id
|
||||
reply_key
|
||||
skipped
|
||||
skipped_reason
|
||||
},
|
||||
on_drop: ->() {
|
||||
STDERR.puts "Removing superflous email_logs columns!"
|
||||
|
@ -0,0 +1,11 @@
|
||||
class DropReplyKeySkippedSkippedReasonFromEmailLogs < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
remove_index :email_logs, [:skipped, :bounced, :created_at]
|
||||
remove_index :email_logs, name: 'idx_email_logs_user_created_filtered'
|
||||
add_index :email_logs, [:user_id, :created_at]
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user