2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-11-13 13:41:36 -05:00
|
|
|
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
|