Sha256: a6db80771f1b56c56c5c3e5a0e4dab4bc462b68082acf9e8dccca25f2f103034

Contents?: true

Size: 243 Bytes

Versions: 5

Compression:

Stored size: 243 Bytes

Contents

class AddStiToHosts < ActiveRecord::Migration
  def self.up
    add_column :hosts, :type, :string
    execute "UPDATE hosts set type='Host::Managed'"
    add_index :hosts, :type
  end

  def self.down
    remove_column :hosts, :type
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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