scinote-web/db/migrate/20161004074754_add_notifications_settings_to_user.rb
2017-06-30 10:23:28 +02:00

13 lines
427 B
Ruby

class AddNotificationsSettingsToUser < ActiveRecord::Migration[4.2]
def up
add_column :users, :assignments_notification, :boolean, default: true
add_column :users, :recent_notification, :boolean, default: true
User.update_all(assignments_notification: true, recent_notification: true)
end
def down
remove_column :users, :assignments_notification
remove_column :users, :recent_notification
end
end