mirror of https://github.com/ghostfolio/ghostfolio
11 changed files with 148 additions and 25 deletions
@ -1,5 +1,8 @@ |
|||||
import { Account, Order, Platform } from '@prisma/client'; |
import { Account, Order, Platform, SymbolProfile } from '@prisma/client'; |
||||
|
|
||||
type AccountWithPlatform = Account & { Platform?: Platform }; |
type AccountWithPlatform = Account & { Platform?: Platform }; |
||||
|
|
||||
export type OrderWithAccount = Order & { Account?: AccountWithPlatform }; |
export type OrderWithAccount = Order & { |
||||
|
Account?: AccountWithPlatform; |
||||
|
SymbolProfile?: SymbolProfile; |
||||
|
}; |
||||
|
@ -0,0 +1,21 @@ |
|||||
|
-- AlterTable |
||||
|
ALTER TABLE "Order" ADD COLUMN "symbolProfileId" TEXT; |
||||
|
|
||||
|
-- CreateTable |
||||
|
CREATE TABLE "SymbolProfile" ( |
||||
|
"countries" JSONB, |
||||
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, |
||||
|
"dataSource" "DataSource" NOT NULL, |
||||
|
"id" TEXT NOT NULL, |
||||
|
"name" TEXT, |
||||
|
"updatedAt" TIMESTAMP(3) NOT NULL, |
||||
|
"symbol" TEXT NOT NULL, |
||||
|
|
||||
|
PRIMARY KEY ("id") |
||||
|
); |
||||
|
|
||||
|
-- CreateIndex |
||||
|
CREATE UNIQUE INDEX "SymbolProfile.dataSource_symbol_unique" ON "SymbolProfile"("dataSource", "symbol"); |
||||
|
|
||||
|
-- AddForeignKey |
||||
|
ALTER TABLE "Order" ADD FOREIGN KEY ("symbolProfileId") REFERENCES "SymbolProfile"("id") ON DELETE SET NULL ON UPDATE CASCADE; |
Loading…
Reference in new issue