Add a migration to fix sequence ownership for CI builds migration
GitLab 17.2 shipped a migration (https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158711) that dropped `p_ci_builds.id`. However, we received a number of reports of users who had unrelated sequences owned by `p_ci_builds.id`, so the migration failed because the objects depended on that column existing. To allow migrations to go through, scan the system catalog for all sequences owned by either `p_ci_builds` or `ci_builds`. Generate the `ALTER SEQUENCE` statement to update the ownership of the sequence using the technique described in https://wiki.postgresql.org/wiki/Fixing_Sequences. Note that we could run all 600+ `ALTER SEQUENCE` commands to bring the database to a consistent state, but to minimize risk we target only on the ones to allow the CI builds migration to proceed. Changelog: fixed Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/468541
显示
- db/post_migrate/20240709014000_fix_sequence_owners_for_ci_builds.rb 700 个添加, 0 个删除...grate/20240709014000_fix_sequence_owners_for_ci_builds.rb
- db/schema_migrations/20240709014000 1 个添加, 0 个删除db/schema_migrations/20240709014000
- spec/migrations/fix_sequence_owners_for_ci_builds_spec.rb 74 个添加, 0 个删除spec/migrations/fix_sequence_owners_for_ci_builds_spec.rb
加载中
想要评论请 注册 或 登录