DEV: Break up PG query in MakePasswordColumnsFromUsersReadOnly (#29167)

We are getting a lock timeout but I can't tell which statement so break
it up.
This commit is contained in:
Alan Guo Xiang Tan
2024-10-11 11:25:55 +08:00
committed by GitHub
parent 2193667e1f
commit d90203f27f

View File

@@ -2,10 +2,19 @@
class MakePasswordColumnsFromUsersReadOnly < ActiveRecord::Migration[7.1]
def up
# remove invalid triggers/functions dependent on the columns to be dropped
execute <<~SQL.squish
execute <<~SQL
DROP TRIGGER IF EXISTS users_password_sync_on_delete_password ON users;
SQL
execute <<~SQL
DROP FUNCTION IF EXISTS delete_user_password;
SQL
execute <<~SQL
DROP TRIGGER IF EXISTS users_password_sync ON users;
SQL
execute <<~SQL
DROP FUNCTION IF EXISTS mirror_user_password_data;
SQL