Skip to content

Remove foreign key constraints to namespace_id & project_id from p_duo_workflow_checkpoints

What does this MR do and why?

Remove foreign key constraints to namespace_id & project_id from p_duo_workflow_checkpoints

  • Because dropping the old partitions creates incidents due to projects and namespaces being high traffic tables (see issues)
  • Because we're dropping older data, we don't really need the data integrity provided by FK constraints

References

Database migrations

See gitlabdotcom testing output

How to set up and validate locally

Run the migrations and in psql use \d p_duo_workflow_checkpoints to see FK have been dropped

bin/rails db:migrate:up:main VERSION=20251006061109
bin/rails db:migrate:up:main VERSION=20251006061128

Run the migrations and in psql use \d p_duo_workflow_checkpoints to see FK have been restored

bin/rails db:migrate:down:main VERSION=20251006061128
bin/rails db:migrate:down:main VERSION=20251006061109

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alper Akgun

Merge request reports

Loading