fix(migration): set database name (#2819)

This commit is contained in:
Silvan 2021-12-08 18:17:50 +01:00 committed by GitHub
parent 5b1267ae93
commit 7ea93bd5b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,10 +4,10 @@ ALTER TABLE zitadel.projections.idps ADD COLUMN type INT2;
-- oidc-type is 0
WITH doa AS (
SELECT i.id, IF(o.idp_id IS NULL, 0, 2) as type
FROM projections.idps i
LEFT JOIN projections.idps_oidc_config o
FROM zitadel.projections.idps i
LEFT JOIN zitadel.projections.idps_oidc_config o
ON o.idp_id = i.id
LEFT JOIN projections.idps_jwt_config j
LEFT JOIN zitadel.projections.idps_jwt_config j
ON j.idp_id = i.id
)
UPDATE zitadel.projections.idps SET type = doa.type FROM doa WHERE doa.id = zitadel.projections.idps.id;