Class: CreateSimpleToggles

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/migrations/create_simple_toggles.rb

Instance Method Summary collapse

Instance Method Details

#changeObject


2
3
4
5
6
7
8
9
10
11
12
# File 'lib/generators/templates/migrations/create_simple_toggles.rb', line 2

def change
  create_table :simple_toggle_toggles do |t|
    t.string :name
    t.boolean :active

    t.timestamps
  end

  add_index :simple_toggle_toggles, :name
  add_index :simple_toggle_toggles, [:name, :active]
end