Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ivanvc/208721 to your computer and use it in GitHub Desktop.
Save ivanvc/208721 to your computer and use it in GitHub Desktop.
class ChangeDefaultDeviceSettings < ActiveRecord::Migration
def self.up
execute "ALTER TABLE `#{User.table_name}` CHANGE `can_dm_me` `can_dm_me` TINYINT(1) NOT NULL DEFAULT 0"
execute "ALTER TABLE `#{User.table_name}` CHANGE `can_email_me` `can_email_me` TINYINT(1) NOT NULL DEFAULT 1"
end
def self.down
execute "ALTER TABLE `#{User.table_name}` CHANGE `can_dm_me` TINYINT(1) NOT NULL DEFAULT 1"
execute "ALTER TABLE `#{User.table_name}` CHANGE `can_email_me` `can_email_me` TINYINT(1) NOT NULL DEFAULT 0"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment