Skip to content
代码片段 群组 项目
提交 421ad305 编辑于 作者: Marius Bobin's avatar Marius Bobin
浏览文件

Merge branch 'sh-use-access-exclusive-lock' into 'master'

Use AccessExclusive lock for adding FK to post-deploy migration

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114363



Merged-by: default avatarMarius Bobin <mbobin@gitlab.com>
Approved-by: default avatarMarius Bobin <mbobin@gitlab.com>
Co-authored-by: default avatarStan Hu <stanhu@gmail.com>
No related branches found
No related tags found
无相关合并请求
......@@ -11,7 +11,7 @@ def up
return if foreign_key_exists?(SOURCE_TABLE_NAME, TARGET_TABLE_NAME, name: FK_NAME)
with_lock_retries do
execute("LOCK TABLE #{TARGET_TABLE_NAME}, #{SOURCE_TABLE_NAME} IN SHARE ROW EXCLUSIVE MODE")
execute("LOCK TABLE #{TARGET_TABLE_NAME}, #{SOURCE_TABLE_NAME} IN ACCESS EXCLUSIVE MODE")
execute(<<~SQL.squish)
ALTER TABLE #{SOURCE_TABLE_NAME}
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册