mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-09 19:43:40 +00:00
47 lines
862 B
PL/PgSQL
47 lines
862 B
PL/PgSQL
BEGIN;
|
|
|
|
TRUNCATE TABLE authz.user_memberships;
|
|
|
|
INSERT INTO authz.user_memberships (
|
|
user_id,
|
|
member_type,
|
|
aggregate_id,
|
|
object_id,
|
|
roles,
|
|
display_name,
|
|
resource_owner,
|
|
resource_owner_name,
|
|
creation_date,
|
|
change_date,
|
|
sequence
|
|
)
|
|
SELECT
|
|
user_id,
|
|
member_type,
|
|
aggregate_id,
|
|
object_id,
|
|
roles,
|
|
display_name,
|
|
resource_owner,
|
|
resource_owner_name,
|
|
creation_date,
|
|
change_date,
|
|
sequence
|
|
FROM auth.user_memberships;
|
|
|
|
UPSERT INTO authz.current_sequences (
|
|
view_name,
|
|
event_timestamp,
|
|
current_sequence,
|
|
last_successful_spooler_run,
|
|
aggregate_type
|
|
)
|
|
SELECT 'authz.user_memberships',
|
|
event_timestamp,
|
|
current_sequence,
|
|
last_successful_spooler_run,
|
|
aggregate_type
|
|
FROM auth.current_sequences
|
|
WHERE view_name = 'auth.user_memberships';
|
|
|
|
COMMIT; |