Sha256: 8ad8ebd09ddc08fd14cb2b5156a003fafe1c3de107574aa70c45df0452913ee6

Contents?: true

Size: 347 Bytes

Versions: 1

Compression:

Stored size: 347 Bytes

Contents

class AddPrimaryToContacts < ActiveRecord::Migration
  def up
    unless columns(:contacts).collect {|c| c.name}.include?('is_primary')
      add_column :contacts, :is_primary, :boolean 
    end
  end
  
  def down
    if columns(:contacts).collect {|c| c.name}.include?('is_primary')
      remove_column :contacts, :is_primary 
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
erp_base_erp_svcs-4.0.0 db/migrate/20131112013047_add_primary_to_contacts.rb