mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
fix: reset login_policy views (to ensure defaults) (#1605)
* fix: reset login_policy views (to ensure defaults) * fix: migration 1.37
This commit is contained in:
parent
7f8df6719f
commit
b172cc2a82
@ -4,28 +4,14 @@ DELETE FROM authz.current_sequences WHERE aggregate_type <> '';
|
|||||||
DELETE FROM adminapi.current_sequences WHERE aggregate_type <> '';
|
DELETE FROM adminapi.current_sequences WHERE aggregate_type <> '';
|
||||||
DELETE FROM notification.current_sequences WHERE aggregate_type <> '';
|
DELETE FROM notification.current_sequences WHERE aggregate_type <> '';
|
||||||
|
|
||||||
BEGIN;
|
ALTER TABLE management.current_sequences ALTER PRIMARY KEY USING COLUMNS(view_name);
|
||||||
|
ALTER TABLE auth.current_sequences ALTER PRIMARY KEY USING COLUMNS(view_name);
|
||||||
ALTER TABLE management.current_sequences DROP CONSTRAINT "primary";
|
ALTER TABLE authz.current_sequences ALTER PRIMARY KEY USING COLUMNS(view_name);
|
||||||
ALTER TABLE auth.current_sequences DROP CONSTRAINT "primary";
|
ALTER TABLE adminapi.current_sequences ALTER PRIMARY KEY USING COLUMNS(view_name);
|
||||||
ALTER TABLE authz.current_sequences DROP CONSTRAINT "primary";
|
ALTER TABLE notification.current_sequences ALTER PRIMARY KEY USING COLUMNS(view_name);
|
||||||
ALTER TABLE adminapi.current_sequences DROP CONSTRAINT "primary";
|
|
||||||
ALTER TABLE notification.current_sequences DROP CONSTRAINT "primary";
|
|
||||||
|
|
||||||
ALTER TABLE management.current_sequences ADD CONSTRAINT "primary" PRIMARY KEY (view_name);
|
|
||||||
ALTER TABLE auth.current_sequences ADD CONSTRAINT "primary" PRIMARY KEY (view_name);
|
|
||||||
ALTER TABLE authz.current_sequences ADD CONSTRAINT "primary" PRIMARY KEY (view_name);
|
|
||||||
ALTER TABLE adminapi.current_sequences ADD CONSTRAINT "primary" PRIMARY KEY (view_name);
|
|
||||||
ALTER TABLE notification.current_sequences ADD CONSTRAINT "primary" PRIMARY KEY (view_name);
|
|
||||||
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
BEGIN;
|
|
||||||
|
|
||||||
ALTER TABLE management.current_sequences DROP COLUMN aggregate_type;
|
ALTER TABLE management.current_sequences DROP COLUMN aggregate_type;
|
||||||
ALTER TABLE auth.current_sequences DROP COLUMN aggregate_type;
|
ALTER TABLE auth.current_sequences DROP COLUMN aggregate_type;
|
||||||
ALTER TABLE authz.current_sequences DROP COLUMN aggregate_type;
|
ALTER TABLE authz.current_sequences DROP COLUMN aggregate_type;
|
||||||
ALTER TABLE adminapi.current_sequences DROP COLUMN aggregate_type;
|
ALTER TABLE adminapi.current_sequences DROP COLUMN aggregate_type;
|
||||||
ALTER TABLE notification.current_sequences DROP COLUMN aggregate_type;
|
ALTER TABLE notification.current_sequences DROP COLUMN aggregate_type;
|
||||||
|
|
||||||
COMMIT;
|
|
9
migrations/cockroach/V1.38__reset_login_policies.sql
Normal file
9
migrations/cockroach/V1.38__reset_login_policies.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
BEGIN;
|
||||||
|
|
||||||
|
TRUNCATE auth.login_policies;
|
||||||
|
TRUNCATE management.login_policies;
|
||||||
|
|
||||||
|
UPDATE auth.current_sequences set current_sequence = 0 where view_name = 'auth.login_policies';
|
||||||
|
UPDATE management.current_sequences set current_sequence = 0 where view_name = 'management.login_policies';
|
||||||
|
|
||||||
|
COMMIT;
|
Loading…
Reference in New Issue
Block a user