Skip to content

Nullify ci_build_id in pages_deployments table when build is destroyed

What does this MR do?

#336442 (closed)

  • I can't use foreign key, as we're planning to move ci_builds to another database
  • existing orphaned pages deployments will be fixed in another MR(to speed up reviews) Currently there are 0 orphaned records in the database(run explain SELECT "pages_deployments".* FROM "pages_deployments" LEFT JOIN ci_builds ON pages_deployments.ci_build_id = ci_builds.id WHERE pages_deployments.ci_build_id IS NOT NULL AND ci_builds.id IS NULL in #database-lab, and see Gather (cost=1001.00..31476.09 rows=1 width=133) (actual time=57.163..70.246 rows=0 on the top node
  • We nullify, not delete records because this field on pages deployment is used only by !67303 (merged) and it handles nulls properly

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #336442 (closed)

Edited by Vladimir Shushlin

Merge request reports