fix(migration): check if ldap2 already exists (#9674)

# Which Problems Are Solved

With v2.71.0 the `idp_templates6_ldap3` projection was created but never
filled, as it was a subtable. To fix this we altered the
`idp_templates6_ldap3` to `idp_templates6_ldap2` with v2.71.5.
This was unfortunately without a check that the `idp_templates_ldap2`was
already existing, which resulted in an error in the setup step.

# How the Problems Are Solved

Add check if `idp_templates6_ldap2` is already existing, before renaming
`idp_templates6_ldap3` -> `idp_templates6_ldap2`.

# Additional Changes

None

# Additional Context

Closes #9669
This commit is contained in:
Stefan Benz
2025-03-31 12:06:40 +02:00
committed by GitHub
parent 817670f1f7
commit 2eb187f141
3 changed files with 27 additions and 3 deletions

2
cmd/setup/52/alter.sql Normal file
View File

@@ -0,0 +1,2 @@
ALTER TABLE IF EXISTS projections.idp_templates6_ldap3 RENAME COLUMN rootCA TO root_ca;
ALTER TABLE IF EXISTS projections.idp_templates6_ldap3 RENAME TO idp_templates6_ldap2;

4
cmd/setup/52/check.sql Normal file
View File

@@ -0,0 +1,4 @@
SELECT 1
FROM information_schema.tables
WHERE table_schema = 'projections'
AND table_name = 'idp_templates6_ldap2';