Sha256: ff696a88a178d6cc3a7194982b4ffd8ba3a2529ff37bb5e18cc0c9bd5da2fd2c

Contents?: true

Size: 444 Bytes

Versions: 2

Compression:

Stored size: 444 Bytes

Contents

class AddEnvironmentToHost < ActiveRecord::Migration
    def self.up
        unless ActiveRecord::Base.connection.columns(:hosts).collect {|c| c.name}.include?("environment")
            add_column :hosts, :environment, :string
        end
    end
    
    def self.down
        if ActiveRecord::Base.connection.columns(:hosts).collect {|c| c.name}.include?("environment")
            remove_column :hosts, :environment
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-0.24.9 lib/puppet/rails/database/003_add_environment_to_host.rb
puppet-0.24.8 lib/puppet/rails/database/003_add_environment_to_host.rb