Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(migrations): add condition to user verification updates for accepted users

Victor Hugo dos Santos7e707e28f0cc
diff --git a/backend/src/db/migrations/20260404140728_username-merge.ts b/backend/src/db/migrations/20260404140728_username-merge.ts
index 12e693f9b6..d8d652642b 100644
--- a/backend/src/db/migrations/20260404140728_username-merge.ts
+++ b/backend/src/db/migrations/20260404140728_username-merge.ts
@@ -40,6 +40,7 @@ export async function up(knex: Knex): Promise<void> {
UPDATE "${TableName.Users}"
SET "isGitHubVerified" = TRUE
WHERE "authMethods" @> ARRAY['github']::text[]
+ AND "isAccepted" = TRUE
AND ("isGitHubVerified" IS NULL OR "isGitHubVerified" = FALSE)
`);
@@ -47,6 +48,7 @@ export async function up(knex: Knex): Promise<void> {
UPDATE "${TableName.Users}"
SET "isGoogleVerified" = TRUE
WHERE "authMethods" @> ARRAY['google']::text[]
+ AND "isAccepted" = TRUE
AND ("isGoogleVerified" IS NULL OR "isGoogleVerified" = FALSE)
`);
@@ -54,6 +56,7 @@ export async function up(knex: Knex): Promise<void> {
UPDATE "${TableName.Users}"
SET "isGitLabVerified" = TRUE
WHERE "authMethods" @> ARRAY['gitlab']::text[]
+ AND "isAccepted" = TRUE
AND ("isGitLabVerified" IS NULL OR "isGitLabVerified" = FALSE)
`);
log(`Step 2 done in ${Date.now() - t}ms`);