From 8c282233436c86ccbdb7a94d90b20df76d1ae111 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 17 Feb 2025 00:10:34 -0600 Subject: [PATCH] refactor: remove 2fa migration --- apps/dokploy/drizzle/0067_migrate-data.sql | 45 ---------------------- 1 file changed, 45 deletions(-) diff --git a/apps/dokploy/drizzle/0067_migrate-data.sql b/apps/dokploy/drizzle/0067_migrate-data.sql index 279acbfb9..8f26fc13e 100644 --- a/apps/dokploy/drizzle/0067_migrate-data.sql +++ b/apps/dokploy/drizzle/0067_migrate-data.sql @@ -26,7 +26,6 @@ WITH inserted_users AS ( "serversQuantity", "expirationDate", "createdAt", - "two_factor_enabled", "isRegistered" ) SELECT @@ -53,30 +52,11 @@ WITH inserted_users AS ( a."serversQuantity", NOW() + INTERVAL '1 year', NOW(), - COALESCE(auth."is2FAEnabled", false), true FROM admin a JOIN auth ON auth.id = a."authId" RETURNING * ), -inserted_two_factor_admin AS ( - -- Insertar registros en two_factor para admins con 2FA habilitado - INSERT INTO two_factor ( - id, - secret, - backup_codes, - user_id - ) - SELECT - gen_random_uuid(), - auth.secret, - gen_random_uuid()::text, - a."adminId" - FROM admin a - JOIN auth ON auth.id = a."authId" - WHERE auth."is2FAEnabled" = true - RETURNING * -), inserted_accounts AS ( -- Insertar cuentas para los admins INSERT INTO account ( @@ -85,7 +65,6 @@ inserted_accounts AS ( "provider_id", "user_id", password, - "is2FAEnabled", "created_at", "updated_at" ) @@ -95,7 +74,6 @@ inserted_accounts AS ( 'credential', a."adminId", auth.password, - COALESCE(auth."is2FAEnabled", false), NOW(), NOW() FROM admin a @@ -143,7 +121,6 @@ inserted_members AS ( "accesedProjects", "accesedServices", "expirationDate", - "two_factor_enabled", "isRegistered" ) SELECT @@ -166,7 +143,6 @@ inserted_members AS ( COALESCE(u."accesedProjects", '{}'), COALESCE(u."accesedServices", '{}'), NOW() + INTERVAL '1 year', - COALESCE(auth."is2FAEnabled", false), COALESCE(u."isRegistered", false) FROM "user" u JOIN admin a ON u."adminId" = a."adminId" @@ -181,7 +157,6 @@ inserted_member_accounts AS ( "provider_id", "user_id", password, - "is2FAEnabled", "created_at", "updated_at" ) @@ -191,7 +166,6 @@ inserted_member_accounts AS ( 'credential', u."userId", auth.password, - COALESCE(auth."is2FAEnabled", false), NOW(), NOW() FROM "user" u @@ -199,25 +173,6 @@ inserted_member_accounts AS ( JOIN auth ON auth.id = u."authId" RETURNING * ), -inserted_two_factor_members AS ( - -- Insertar registros en two_factor para miembros con 2FA habilitado - INSERT INTO two_factor ( - id, - secret, - backup_codes, - user_id - ) - SELECT - gen_random_uuid(), - auth.secret, - gen_random_uuid()::text, - u."userId" - FROM "user" u - JOIN admin a ON u."adminId" = a."adminId" - JOIN auth ON auth.id = u."authId" - WHERE auth."is2FAEnabled" = true - RETURNING * -), inserted_admin_members AS ( -- Insertar miembros en las organizaciones (admins como owners) INSERT INTO member (