FEATURE: Support an end date for user silencing

This commit is contained in:
Robin Ward
2017-11-13 13:41:36 -05:00
parent 52480d554a
commit 971e302ff2
33 changed files with 456 additions and 114 deletions

View File

@@ -72,6 +72,17 @@ ColumnDropper.drop(
}
)
ColumnDropper.drop(
table: 'users',
after_migration: 'AddSilencedTillToUsers',
columns: %w[
silenced
],
on_drop: ->() {
STDERR.puts 'Removing user silenced column!'
}
)
# User for the smoke tests
if ENV["SMOKE"] == "1"
UserEmail.seed do |ue|

View File

@@ -0,0 +1,14 @@
class AddSilencedTillToUsers < ActiveRecord::Migration[5.1]
def up
add_column :users, :silenced_till, :timestamp, null: true
execute <<~SQL
UPDATE users
SET silenced_till = CURRENT_TIMESTAMP + INTERVAL '1000 YEAR'
WHERE silenced
SQL
end
def down
add_column :users, :silenced_till
end
end