Sha256: 52720ff92c8f0d177d9b93516082dc443019c5c9d96a97e7e511fc148f9dfd73

Contents?: true

Size: 428 Bytes

Versions: 5

Compression:

Stored size: 428 Bytes

Contents

class AddEnvironmentsToModules < ActiveRecord::Migration[4.2]
  def up
    create_table 'salt_module_environments' do |t|
      t.references :salt_module
      t.references :salt_environment
    end

    environments = ForemanSalt::SaltEnvironment.all
    ForemanSalt::SaltModule.all.find_each do |state|
      state.salt_environments << environments
    end
  end

  def down
    drop_table :salt_module_environments
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_salt-17.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-17.0.0 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-16.0.3 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-16.0.2 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-16.0.1 db/migrate/20150411003302_add_environments_to_modules.rb