mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-27 17:52:14 +00:00
refactor: relational identity provider table and projection (#11739)
This commit is contained in:
+2
-4
@@ -10,13 +10,11 @@ CREATE TABLE zitadel.identity_providers (
|
||||
, state zitadel.idp_state NOT NULL DEFAULT 'active'
|
||||
, name TEXT NOT NULL CHECK (name <> '')
|
||||
, type SMALLINT DEFAULT NULL
|
||||
, auto_register BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_creation BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_auto_creation BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_auto_update BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, allow_linking BOOLEAN NOT NULL DEFAULT TRUE
|
||||
, auto_linking_field SMALLINT DEFAULT NULL
|
||||
, styling_type SMALLINT
|
||||
, payload JSONB
|
||||
|
||||
, created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
@@ -25,8 +23,8 @@ CREATE TABLE zitadel.identity_providers (
|
||||
, PRIMARY KEY (instance_id, id)
|
||||
, CONSTRAINT identity_providers_id_unique UNIQUE NULLS NOT DISTINCT (instance_id, org_id, id)
|
||||
, CONSTRAINT identity_providers_name_unique UNIQUE NULLS NOT DISTINCT (instance_id, org_id, name)
|
||||
, FOREIGN KEY (instance_id) REFERENCES zitadel.instances(id)
|
||||
, FOREIGN KEY (instance_id, org_id) REFERENCES zitadel.organizations(instance_id, id)
|
||||
, FOREIGN KEY (instance_id) REFERENCES zitadel.instances(id) ON DELETE CASCADE
|
||||
, FOREIGN KEY (instance_id, org_id) REFERENCES zitadel.organizations(instance_id, id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
-- CREATE INDEX idx_identity_providers_org_id ON identity_providers(instance_id, org_id) WHERE org_id IS NOT NULL;
|
||||
|
||||
Reference in New Issue
Block a user