Sha256: 5f9a9bd26e9714df88b7246a50807f4e5a8e100e69e2251de1fa7d954b2dae94

Contents?: true

Size: 610 Bytes

Versions: 5

Compression:

Stored size: 610 Bytes

Contents

class ChangePuppetmasterColumn < ActiveRecord::Migration
  def self.up
    # Hosts
    rename_column :hosts, :puppetmaster, :puppetmaster_name
    add_column    :hosts, :puppetproxy_id, :integer

    # Hostgroups
    rename_column :hostgroups, :puppetmaster, :puppetmaster_name
    add_column    :hostgroups, :puppetproxy_id, :integer
  end

  def self.down
    #Hosts
    remove_column :hosts, :puppetproxy_id
    rename_column :hosts, :puppetmaster_name, :puppetmaster

    #Hostgroups
    remove_column :hostgroups, :puppetproxy_id
    rename_column :hostgroups, :puppetmaster_name, :puppetmaster
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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