scinote-web/db/migrate/20161006065203_add_email_notification_settings_to_user.rb

15 lines
491 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class AddEmailNotificationSettingsToUser < ActiveRecord::Migration[4.2]
def up
add_column :users, :assignments_notification_email, :boolean, default: false
add_column :users, :recent_notification_email, :boolean, default: false
User.update_all(assignments_notification_email: false,
recent_notification_email: false)
end
def down
remove_column :users, :assignments_notification_email
remove_column :users, :recent_notification_email
end
end