Sha256: f320007d26fc9fcc5bcf5dd3202b3422e8848f5947f273325ae65449a418d375

Contents?: true

Size: 511 Bytes

Versions: 3

Compression:

Stored size: 511 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

3 entries across 3 versions & 1 rubygems

Version Path
eav_hashes-1.1.0 lib/generators/eav_migration/templates/eav_migration.erb
eav_hashes-1.0.3 lib/generators/eav_migration/templates/eav_migration.erb
eav_hashes-1.0.2 lib/generators/eav_migration/templates/eav_migration.erb