scinote-web/db/migrate/20161004074754_add_notifications_settings_to_user.rb

14 lines
427 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class AddNotificationsSettingsToUser < ActiveRecord::Migration[4.2]
2016-10-04 21:52:48 +08:00
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