Sha256: 81c6b45626aaa57cad11dfe0b369d4840d71ab893bda49fe66759cb052014206

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

# AWEXOME LABS
# DoesKeyValue
#
# CreateKeyValueIndex -- generated migration template for key/value index table

class CreateKeyValueIndex < ActiveRecord::Migration
  def self.up
    create_table :key_value_index do |t|
      t.string :obj_type
      t.string :key_name
      t.string :value
      t.integer :obj_id
      
      t.timestamps
    end
    
    # Index is important here:
    add_index :key_value_index, [:obj_type, :key_name, :value]
  end

  def self.down
    drop_table :key_value_index
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
doeskeyvalue-0.2.2 lib/generators/doeskeyvalue/templates/create_key_value_index.rb
doeskeyvalue-0.2.1 lib/generators/doeskeyvalue/templates/create_key_value_index.rb
doeskeyvalue-0.2.0 lib/generators/doeskeyvalue/templates/create_key_value_index.rb
doeskeyvalue-0.1.3 lib/generators/doeskeyvalue/templates/create_key_value_index.rb
doeskeyvalue-0.1.2 lib/generators/doeskeyvalue/templates/create_key_value_index.rb