clarion/db/migrate/20141010142514_change_event_state_defaults.rb
2019-04-28 22:02:02 +03:00

11 lines
266 B
Ruby

class ChangeEventStateDefaults < ActiveRecord::Migration[4.2]
def up
execute "UPDATE events SET state = 0"
change_column :events, :state, :integer, null: false, default: 0
end
def down
change_column :events, :state, :integer, null: true
end
end