Sha256: aa318a69bea71d35eb45c432d498bb6dbf45eb8f6aefadbcf0c5e6d32ea4b53c

Contents?: true

Size: 316 Bytes

Versions: 36

Compression:

Stored size: 316 Bytes

Contents

class CleanupEnvironmentFromCoreTables < ActiveRecord::Migration[6.0]
  def up
    ::Hostgroup.update_all(environment_id: nil) if column_exists?(:hostgroups, :environment_id)
    Host::Managed.update_all(environment_id: nil) if column_exists?(:hosts, :environment_id)
  end

  def down
    # nothing to do
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
foreman_puppet-2.0.7 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-4.0.1 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-4.0.0 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-3.0.6 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-2.0.6 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-2.0.5 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-3.0.5 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-3.0.4 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-2.0.4 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-3.0.3 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-3.0.2 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-2.0.3 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-3.0.1 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-2.0.2 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-2.0.0 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
foreman_puppet-1.0.5 db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb