From da52d767eb33d9bd5fa7f93db93e9bf60447ca69 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 22 Jun 2025 00:52:45 -0600 Subject: [PATCH] refactor(git_provider): update userId assignment to use owner_id from organization table - Changed the SQL update statement to directly select the owner_id from the organization table instead of joining with the account table, simplifying the query. --- apps/dokploy/drizzle/0094_numerous_carmella_unuscione.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/drizzle/0094_numerous_carmella_unuscione.sql b/apps/dokploy/drizzle/0094_numerous_carmella_unuscione.sql index 5f259a442..216c43180 100644 --- a/apps/dokploy/drizzle/0094_numerous_carmella_unuscione.sql +++ b/apps/dokploy/drizzle/0094_numerous_carmella_unuscione.sql @@ -1,12 +1,11 @@ ALTER TABLE "git_provider" ADD COLUMN "userId" text;--> statement-breakpoint -- Update existing git providers to be owned by the organization owner --- We need to get the account.user_id for the organization owner +-- We can get the owner_id directly from the organization table UPDATE "git_provider" SET "userId" = ( - SELECT a.user_id + SELECT o."owner_id" FROM "organization" o - JOIN "account" a ON o."owner_id" = a.user_id WHERE o.id = "git_provider"."organizationId" );--> statement-breakpoint