Project

General

Profile

« Previous | Next » 

Revision c41f1124

Added by Ondřej Ezr over 2 years ago

Fixes #31732 - drop env from TemplateCombination migration

Drop environment relation from TemplateCombination migrations.

View differences:

db/migrate/20101121135521_create_template_combinations.rb
create_table :template_combinations do |t|
t.references :config_template
t.references :hostgroup
t.references :environment
t.timestamps null: true
end
db/migrate/20130908170524_add_keys.rb
add_foreign_key "subnets", "smart_proxies", :name => "subnets_tftp_id_fk", :column => "tftp_id"
add_foreign_key "taxable_taxonomies", "taxonomies", :name => "taxable_taxonomies_taxonomy_id_fk"
add_foreign_key "template_combinations", "config_templates", :name => "template_combinations_config_template_id_fk"
add_foreign_key "template_combinations", "environments", :name => "template_combinations_environment_id_fk"
add_foreign_key "template_combinations", "hostgroups", :name => "template_combinations_hostgroup_id_fk"
add_foreign_key "tokens", "hosts", :name => "tokens_host_id_fk"
add_foreign_key "user_compute_resources", "compute_resources", :name => "user_compute_resources_compute_resource_id_fk"
lib/tasks/cleanup.rake
task puppet: :environment do
raise('You have the Puppet plugin installed, uninstall it first to purge puppet data') if Foreman::Plugin.find(:foreman_puppet)
if ActiveRecord::Base.connection.column_exists?(:template_combinations, :environment_id)
ActiveRecord::Base.connection.remove_reference(:template_combinations, :environment)
end
envs = %w[view_environments create_environments edit_environments destroy_environments import_environments]
cfgs = %w[view_config_groups create_config_groups edit_config_groups destroy_config_groups]
plks = %w[view_external_parameters create_external_parameters edit_external_parameters
......
Feature.where(name: 'Puppet').destroy_all
end
task all: ['purge:trends']
task all: ['purge:trends', 'purge:puppet']
end
task purge_data: 'purge:all'

Also available in: Unified diff