Skip to content

Commit 274daf5

Browse files
authored
Merge pull request #2062 from Dokploy/fix/migration-git-permissions
refactor(git_provider): update userId assignment to use owner_id from…
2 parents 45a178e + da52d76 commit 274daf5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/dokploy/drizzle/0094_numerous_carmella_unuscione.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
ALTER TABLE "git_provider" ADD COLUMN "userId" text;--> statement-breakpoint
22

33
-- Update existing git providers to be owned by the organization owner
4-
-- We need to get the account.user_id for the organization owner
4+
-- We can get the owner_id directly from the organization table
55
UPDATE "git_provider"
66
SET "userId" = (
7-
SELECT a.user_id
7+
SELECT o."owner_id"
88
FROM "organization" o
9-
JOIN "account" a ON o."owner_id" = a.user_id
109
WHERE o.id = "git_provider"."organizationId"
1110
);--> statement-breakpoint
1211

0 commit comments

Comments
 (0)