Sha256: 32ec355569ef971c028421e09f33074ea0ff3fe120f262fb7e56999f95719433

Contents?: true

Size: 526 Bytes

Versions: 2

Compression:

Stored size: 526 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration
  def change
    create_table :<%= table_name %> do |t|
      t.references :<%= model_association_name %>, :null => false
      t.string :entry_key, :null => false
      t.text :value, :null => false
      t.integer :value_type, :null => false
      t.boolean :symbol_key, :null => false, :default => true

      t.timestamps
    end

    add_index :<%= table_name %>, :<%= model_association_name %>_id
    add_index :<%= table_name %>, :entry_key
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eav_hashes-1.0.1 lib/generators/eav_migration/templates/eav_migration.erb
eav_hashes-1.0.0 lib/generators/eav_migration/templates/eav_migration.erb