mirror of
https://github.com/juspay/hyperswitch.git
synced 2026-03-13 09:02:06 +08:00
fix(user_roles): migrations for backfilling user_roles entity_id (#6837)
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
SELECT 1;
|
||||
UPDATE user_roles SET entity_type = NULL WHERE version = 'v1';
|
||||
@@ -1,4 +1,5 @@
|
||||
-- Your SQL goes here
|
||||
-- Incomplete migration, also run migrations/2024-12-13-080558_entity-id-backfill-for-user-roles
|
||||
UPDATE user_roles
|
||||
SET
|
||||
entity_type = CASE
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
UPDATE user_roles SET entity_id = NULL WHERE version = 'v1';
|
||||
@@ -0,0 +1,10 @@
|
||||
-- Your SQL goes here
|
||||
UPDATE user_roles
|
||||
SET
|
||||
entity_id = CASE
|
||||
WHEN role_id = 'org_admin' THEN org_id
|
||||
ELSE merchant_id
|
||||
END
|
||||
WHERE
|
||||
version = 'v1'
|
||||
AND entity_id IS NULL;
|
||||
Reference in New Issue
Block a user