diff --git a/db/migrate/20171101102630_clean_up_duplicates_in_containers_tables.rb b/db/migrate/20171101102630_clean_up_duplicates_in_containers_tables.rb index c7d1dab38..7bc6254cc 100644 --- a/db/migrate/20171101102630_clean_up_duplicates_in_containers_tables.rb +++ b/db/migrate/20171101102630_clean_up_duplicates_in_containers_tables.rb @@ -25,6 +25,7 @@ class ComputerSystem < ActiveRecord::Base; end class ContainerEnvVar < ActiveRecord::Base; end class ContainerLimitItem < ActiveRecord::Base; end class ContainerPortConfig < ActiveRecord::Base; end + class ContainerQuotaScope < ActiveRecord::Base; end class ContainerQuotaItem < ActiveRecord::Base; end class ContainerServicePortConfig < ActiveRecord::Base; end class ContainerTemplateParameter < ActiveRecord::Base; end @@ -58,6 +59,7 @@ def cleanup_duplicate_data_delete_all(model, unique_index_columns) ContainerRoute => [:ems_id, :ems_ref], ContainerService => [:ems_id, :ems_ref], ContainerTemplate => [:ems_id, :ems_ref], + Container => [:ems_id, :ems_ref], PersistentVolumeClaim => [:ems_id, :ems_ref], # Having :ems_id but not ems_ref ContainerImage => [:ems_id, :image_ref], @@ -69,6 +71,7 @@ def cleanup_duplicate_data_delete_all(model, unique_index_columns) ContainerEnvVar => [:container_id, :name, :value, :field_path], ContainerLimitItem => [:container_limit_id, :resource, :item_type], ContainerPortConfig => [:container_id, :ems_ref], + ContainerQuotaScope => [:container_quota_id, :scope], ContainerQuotaItem => [:container_quota_id, :resource], ContainerServicePortConfig => [:container_service_id, :name], ContainerTemplateParameter => [:container_template_id, :name], @@ -76,8 +79,6 @@ def cleanup_duplicate_data_delete_all(model, unique_index_columns) CustomAttribute => [:resource_id, :resource_type, :name, :unique_name, :section, :source], Hardware => [:vm_or_template_id, :host_id, :computer_system_id], OperatingSystem => [:vm_or_template_id, :host_id, :computer_system_id], - # Questionable - Container => [:ems_id, :ems_ref] }.freeze def up diff --git a/db/migrate/20171101102659_add_unique_indexes_to_containers_tables.rb b/db/migrate/20171101102659_add_unique_indexes_to_containers_tables.rb index 3ddaaa852..ed65e2516 100644 --- a/db/migrate/20171101102659_add_unique_indexes_to_containers_tables.rb +++ b/db/migrate/20171101102659_add_unique_indexes_to_containers_tables.rb @@ -52,6 +52,9 @@ def change add_index :container_quota_items, [:container_quota_id, :resource], :unique => true + add_index :container_quota_scopes, + [:container_quota_id, :scope], + :unique => true add_index :container_service_port_configs, [:container_service_id, :name], :unique => true,