Sha256: c2cf3516301389edf8509953b8ae89b8be7041c3842836d9997367b726cfc762

Contents?: true

Size: 462 Bytes

Versions: 5

Compression:

Stored size: 462 Bytes

Contents

require 'uuid'

class AddUuidCompassAeInstance < ActiveRecord::Migration
  def self.up
    unless columns(:compass_ae_instances).collect {|c| c.name}.include?('guid')
      add_column :compass_ae_instances, :guid, :string
      add_index :compass_ae_instances, :guid, :name => "guid_idx"
    end
  end

  def self.down
    if columns(:compass_ae_instances).collect {|c| c.name}.include?('guid')
      remove_column :compass_ae_instances, :guid
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
erp_base_erp_svcs-4.0.0 db/migrate/20130404171435_add_uuid_compass_ae_instance.rb
erp_base_erp_svcs-3.1.5 db/migrate/20130404171435_add_uuid_compass_ae_instance.rb
erp_base_erp_svcs-3.1.4 db/migrate/20130404171435_add_uuid_compass_ae_instance.rb
erp_base_erp_svcs-3.1.3 db/migrate/20130404171435_add_uuid_compass_ae_instance.rb
erp_base_erp_svcs-3.1.2 db/migrate/20130404171435_add_uuid_compass_ae_instance.rb