DEV: Drop duration column from topic timers (#13543)

The duration column has been ignored since the commit
4af77f1e38
for topic_timers, we use duration_minutes instead.

Also removing the duration key from Topic.set_or_create_timer. The only
plugin to use this was discourse-solved, which doesn't use it any
longer
since
c722b94a97
This commit is contained in:
Martin Brennan
2021-06-29 09:27:12 +10:00
committed by GitHub
parent 03338f9086
commit d098f51ad3
2 changed files with 21 additions and 24 deletions

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
class DropDurationColumnFromTopicTimers < ActiveRecord::Migration[6.1]
DROPPED_COLUMNS ||= {
topic_timers: %i{duration}
}
def up
DROPPED_COLUMNS.each do |table, columns|
Migration::ColumnDropper.execute_drop(table, columns)
end
end
def down
add_column :topic_timers, :duration, :string
end
end