Feature/add user id to symbol profile database schema (#4122)
* Add userId to SymbolProfile database schema * Update changelogpull/4123/head^2
parent
57659d2c04
commit
de68841843
@ -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