Class: CreateOptOuts
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateOptOuts
- Defined in:
- lib/generators/templates/opt_outs_migration.rb
Instance Method Summary collapse
Instance Method Details
#down ⇒ Object
12 13 14 |
# File 'lib/generators/templates/opt_outs_migration.rb', line 12 def down drop_table :opt_outs end |
#up ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/generators/templates/opt_outs_migration.rb', line 2 def up create_table :opt_outs do |t| t.integer :user_id t.string :feature t. end add_index :opt_outs, [:user_id, :feature], unique: true end |