Sha256: c02ce1ef83774a3b93720e7593005efa16b86c3f57cfc7741dd3c679c57304a9

Contents?: true

Size: 468 Bytes

Versions: 5

Compression:

Stored size: 468 Bytes

Contents

class AddSubnetAndDomainToHostGroups < ActiveRecord::Migration
  def self.up
    add_column :hostgroups, :subnet_id, :integer unless column_exists? :hostgroups, :subnet_id
    add_column :hostgroups, :domain_id, :integer unless column_exists? :hostgroups, :domain_id
  end

  def self.down
    remove_column :hostgroups, :subnet_id if column_exists? :hostgroups, :subnet_id
    remove_column :hostgroups, :domain_id if column_exists? :hostgroups, :domain_id
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/db/migrate/20110803114134_add_subnet_and_domain_to_host_groups.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/db/migrate/20110803114134_add_subnet_and_domain_to_host_groups.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/db/migrate/20110803114134_add_subnet_and_domain_to_host_groups.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/db/migrate/20110803114134_add_subnet_and_domain_to_host_groups.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/db/migrate/20110803114134_add_subnet_and_domain_to_host_groups.rb