mirror of https://github.com/ghostfolio/ghostfolio
Thomas Kaul
1 month ago
committed by
GitHub
5 changed files with 39 additions and 12 deletions
@ -0,0 +1,15 @@ |
|||||
|
-- AlterTable |
||||
|
ALTER TABLE "SymbolProfile" ADD COLUMN "userId" TEXT; |
||||
|
|
||||
|
-- AddForeignKey |
||||
|
ALTER TABLE "SymbolProfile" ADD CONSTRAINT "SymbolProfile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
||||
|
|
||||
|
-- Set userIds in SymbolProfile for 'MANUAL' data source |
||||
|
UPDATE "SymbolProfile" |
||||
|
SET "userId" = ( |
||||
|
SELECT "userId" |
||||
|
FROM "Order" |
||||
|
WHERE "Order"."symbolProfileId" = "SymbolProfile"."id" |
||||
|
LIMIT 1 |
||||
|
) |
||||
|
WHERE "dataSource" = 'MANUAL'; |
Loading…
Reference in new issue