Loading
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:
- !231142 (closed): trigger that wrote the rows
- !229866 (closed): switching logic
- !231138 (closed): backfills
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_buildswithwith_lock_retriesandreverse_lock_order.p_ci_buildsis 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
- Run
bin/rails db:migrate:ci. Both migrations apply. - Run
bin/rails db:migrate:down:ci VERSION=20261104140210, thenVERSION=20261104140149. The table, its partitions, its index and the foreign key come back. - Run
bin/rails db:migrate:ciagain. Both migrations apply again.