Skip to content
代码片段 群组 项目
未验证 提交 e18f5a7e 编辑于 作者: Stan Hu's avatar Stan Hu
浏览文件

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
上级 5ccfad23
No related branches found
No related tags found
无相关合并请求
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册