Class: CreateEnumerations

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

Instance Method Summary collapse

Instance Method Details

#changeObject



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

def change
  create_table :enumerations, options: 'DEFAULT CHARSET=utf8' do |t|
    t.string :name, null: false, limit: 128
    t.string :type, null: false

    t.timestamps
  end
  add_index :enumerations, :name
  add_index :enumerations, :type
  add_index :enumerations, [:name, :type]
end