Class: EasyKeyValueMigration

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

Instance Method Summary collapse

Instance Method Details

#changeObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/ekv/migrations/templates/migrations/1_easy_key_value_migration.rb', line 3

def change
  create_table :easy_key_values do |t|
    t.integer :ekv_id
    t.string :ekv_type

    t.string :key
    t.text :value
  end

  add_index :easy_key_values, :ekv_id, :name => 'ekv_id_ix'
  add_index :easy_key_values, :key, :name => 'key_ix'
end