Sha256: ad7cea2f5dd715a007f520c98ddc6b9f60269212a0173294ca8897945157935d

Contents?: true

Size: 303 Bytes

Versions: 2

Compression:

Stored size: 303 Bytes

Contents

class AddUniqueIndexOnLocks < ActiveRecord::Migration
  def self.up
    remove_index(:locks, :name => "idx_resource_key")
    add_index(:locks, [:resource_name, :key], {:name => "idx_resource_key", :unique => true})
  end

  def self.down
    remove_index(:locks, :name => "idx_resource_key")
  end
end

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
apl-library-0.0.90 db/migrate/20120907123044_add_unique_index_on_locks.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/db/migrate/20120907123044_add_unique_index_on_locks.rb