Sha256: 364a132e3107932767d7aa12c7a975d904a466b8d12dbe1da19b19292c9ebd8f

Contents?: true

Size: 418 Bytes

Versions: 21

Compression:

Stored size: 418 Bytes

Contents

class AddEnvironmentsToModules < ActiveRecord::Migration
  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.each do |state|
      state.salt_environments << environments
    end
  end

  def down
    drop_table :salt_module_environments
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
foreman_salt-8.0.4 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-9.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-9.0.0 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-8.0.3 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-8.0.2 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-8.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-7.0.3 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-8.0.0 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-7.0.2 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-6.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-7.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-7.0.0 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-6.0.0 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-5.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-5.0.0 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-4.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-4.0.0 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-3.0.2 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-3.0.1 db/migrate/20150411003302_add_environments_to_modules.rb
foreman_salt-3.0.0 db/migrate/20150411003302_add_environments_to_modules.rb