discourse/db/migrate/20171113175414_add_silenced_till_to_users.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
366 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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