Sha256: 156d093109f81003b4cf950dc8046d9c7586790dd16ae12ae58e89dbffe49c53

Contents?: true

Size: 541 Bytes

Versions: 3

Compression:

Stored size: 541 Bytes

Contents

class CreateUuidifyUuids < ActiveRecord::Migration
  def up
    create_table :uuidify_uuids do |t|
      t.string :model_name
      t.integer :model_id
#      t.string :model_uuid, :limit => 36
    end
    
    execute "ALTER TABLE uuidify_uuids ADD COLUMN model_uuid BINARY(16)"
    add_index :uuidify_uuids, [:model_name, :model_id], :unique => true
    add_index :uuidify_uuids, :model_uuid, :unique => true
    add_index :uuidify_uuids, [:model_uuid, :model_id], :unique => true
  end

  def down
    drop_table :uuidify_uuids
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uuidify-0.4.0 db/migrate/20130612143347_create_uuidify_uuids.rb
uuidify-0.3.1 db/migrate/20130612143347_create_uuidify_uuids.rb
uuidify-0.3.0 db/migrate/20130612143347_create_uuidify_uuids.rb