Skip to content

Add namespace_id DB constraints

When migration of routes is finished and when project namespace is backfilled for each project, we can:

  • add "not null" constraint for routes namespace_id column
  • change add_concurrent_foreign_key :routes, :namespaces, column: :namespace_id, on_delete: :nullify to add_concurrent_foreign_key :routes, :namespaces, column: :namespace_id, on_delete: :cascade

It's not safe to do this until there is a chance that project namespaces are deleted (e.g. during backfilling process).


Availability and Testing

  • Please run package-and-qa job for MR to ensure no regressions occur. Some areas to keep an eye on for errors would be during resource fabrication (when creating groups and projects), as well as in any after hooks for errors on resource deletion (deleting groups and projects).
Edited by Valerie Burton