fix(setup): member role synchronization execution check (#11180)

The change was introduced in
https://github.com/zitadel/zitadel/pull/11178.
The fix is to prevent wiping the memberships because the projection did
not init yet.

### Changes
- Introduces a check to determine if the member role synchronization
should be executed based on the existence of a specific database table
(`projections.instance_members4`).
- Ensures that the synchronization process only runs if the required
table is present in the database.
This commit is contained in:
Silvan
2025-12-12 10:09:03 +00:00
committed by GitHub
parent 58612a6ef7
commit 1b54a9eb05
2 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -278,6 +278,7 @@ func Setup(ctx context.Context, config *Config, steps *Steps, masterKey string)
steps.s63AlterResourceCounts,
steps.s64ChangePushPosition,
steps.s65FixUserMetadata5Index,
steps.s67SyncMemberRoleFields,
} {
setupErr = executeMigration(ctx, eventstoreClient, step, "migration failed")
if setupErr != nil {
@@ -341,7 +342,6 @@ func Setup(ctx context.Context, config *Config, steps *Steps, masterKey string)
steps.s48Apps7SAMLConfigsLoginVersion,
steps.s59SetupWebkeys, // this step needs commands.
steps.s66SessionRecoveryCodeCheckedAt,
steps.s67SyncMemberRoleFields,
} {
setupErr = executeMigration(ctx, eventstoreClient, step, "migration failed")
if setupErr != nil {