Sha256: e1b486b2c87ad6014d5eee2da7ca2ab9d5a5535907a50466902c38d1c9c46360

Contents?: true

Size: 779 Bytes

Versions: 1

Compression:

Stored size: 779 Bytes

Contents

class CreatePuppetclasses < ActiveRecord::Migration[4.2]
  def up
    create_table :puppetclasses do |t|
      t.string :name, limit: 255
      t.string :nameindicator, limit: 255
      t.integer :operatingsystem_id

      t.timestamps null: true
    end
    add_foreign_key(:environments_puppetclasses, :puppetclasses)

    create_table :hosts_puppetclasses, id: false do |t|
      t.references :puppetclass, null: false
      t.references :host, null: false
    end

    create_table :operatingsystems_puppetclasses, id: false do |t|
      t.references :puppetclass, null: false
      t.references :operatingsystem, null: false
    end
  end

  def down
    drop_table :puppetclasses
    drop_table :hosts_puppetclasses
    drop_table :operatingsystems_puppetclasses
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_puppet-2.0.0.alpha.2 db/migrate_foreman/20090802062223_create_puppetclasses.rb