Drop unused p_ci_builds_partition_overrides table

Summary

Drops the unused p_ci_builds_partition_overrides table. Nothing reads from it or writes to it, and it holds no rows.

Approach

!228838 (merged) added the table as step 1 of the INC-8367 corrective action. The three follow-up merge requests that would use it were closed without merge:

The table has no model and no application code uses it, so the code removal and the drop go in one merge request. The table is empty, so the drop is cheap.

Changes:

  • A post-deploy migration removes the foreign key to p_ci_builds with with_lock_retries and reverse_lock_order. p_ci_builds is a high-traffic table.
  • A second post-deploy migration drops the table and its 3 hash partitions.
  • The loose foreign key entry, the retention policy allowlist entry and the development seed are removed.
  • The database dictionary file moves to db/docs/deleted_tables/.

ci_partitions.builds_id_range, also added by !228838 (merged), stays. A separate merge request will remove it.

Local testing

Migration check
  1. Run bin/rails db:migrate:ci. Both migrations apply.
  2. Run bin/rails db:migrate:down:ci VERSION=20261104140210, then VERSION=20261104140149. The table, its partitions, its index and the foreign key come back.
  3. Run bin/rails db:migrate:ci again. Both migrations apply again.

Merge request reports

Loading
Loading