BackfillEnvironmentIdDeploymentMergeRequests: ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: insert or update on table "deployment_merge_requests" violates f...
https://sentry.gitlab.net/gitlab/gitlabcom/issues/1564066/?referrer=gitlab_plugin
PG::ForeignKeyViolation: ERROR: insert or update on table "deployment_merge_requests" violates foreign key constraint "fk_a064ff4453"
DETAIL: Key (environment_id)=(1315373) is not present in table "environments".
active_record/connection_adapters/postgresql/database_statements.rb:92:in `exec'
@connection.async_exec(sql)
active_record/connection_adapters/postgresql/database_statements.rb:92:in `block (2 levels) in execute'
@connection.async_exec(sql)
active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
yield
active_support/concurrency/share_lock.rb:187:in `yield_shares'
yield
active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
@lock.yield_shares(compatible: [:load]) do
...
(91 additional frame(s) were not displayed)
ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: insert or update on table "deployment_merge_requests" violates foreign key constraint "fk_a064ff4453"
DETAIL: Key (environment_id)=(1315373) is not present in table "environments".
PG::ForeignKeyViolation: ERROR: insert or update on table "deployment_merge_requests" violates foreign key constraint "fk_a064ff4453"
DETAIL: Key (environment_id)=(1315373) is not present in table "environments".