diff --git a/app/models/runtime/domain.rb b/app/models/runtime/domain.rb index 6b1c3fbdbb1..56839444059 100644 --- a/app/models/runtime/domain.rb +++ b/app/models/runtime/domain.rb @@ -67,7 +67,8 @@ def shared_or_owned_by(organization_ids) join_table: 'organizations_private_domains', left_key: :private_domain_id, right_key: :organization_id, - before_add: :validate_add_shared_organization + before_add: :validate_add_shared_organization, + ignored_unique_constraint_violation_errors: %w[orgs_pd_ids] ) add_association_dependencies( diff --git a/app/models/runtime/route.rb b/app/models/runtime/route.rb index f2b3e7fd375..70fd484ca42 100644 --- a/app/models/runtime/route.rb +++ b/app/models/runtime/route.rb @@ -31,7 +31,8 @@ class InvalidOrganizationRelation < CloudController::Errors::InvalidRelation; en right_key: :target_space_guid, right_primary_key: :guid, join_table: :route_shares, - class: VCAP::CloudController::Space + class: VCAP::CloudController::Space, + ignored_unique_constraint_violation_errors: %w[route_shares.PRIMARY route_target_space_pk] one_to_one :route_binding one_through_one :service_instance, join_table: :route_bindings diff --git a/app/models/services/service_instance.rb b/app/models/services/service_instance.rb index 6bb76d633e2..a2241c7d2e2 100644 --- a/app/models/services/service_instance.rb +++ b/app/models/services/service_instance.rb @@ -42,7 +42,8 @@ class InvalidServiceBinding < StandardError; end right_key: :target_space_guid, right_primary_key: :guid, join_table: :service_instance_shares, - class: VCAP::CloudController::Space + class: VCAP::CloudController::Space, + ignored_unique_constraint_violation_errors: %w[service_instance_shares.PRIMARY service_instance_target_space_pk] many_to_many :routes, join_table: :route_bindings