|
@ -1,22 +1,22 @@ |
|
|
datasource db { |
|
|
|
|
|
provider = "postgresql" |
|
|
|
|
|
url = env("DATABASE_URL") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
generator client { |
|
|
generator client { |
|
|
provider = "prisma-client-js" |
|
|
provider = "prisma-client-js" |
|
|
binaryTargets = ["debian-openssl-1.1.x", "native"] |
|
|
|
|
|
previewFeatures = [] |
|
|
previewFeatures = [] |
|
|
|
|
|
binaryTargets = ["debian-openssl-1.1.x", "native"] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
datasource db { |
|
|
|
|
|
provider = "postgresql" |
|
|
|
|
|
url = env("DATABASE_URL") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model Access { |
|
|
model Access { |
|
|
createdAt DateTime @default(now()) |
|
|
createdAt DateTime @default(now()) |
|
|
GranteeUser User? @relation(fields: [granteeUserId], name: "accessGet", references: [id]) |
|
|
|
|
|
granteeUserId String? |
|
|
granteeUserId String? |
|
|
id String @id @default(uuid()) |
|
|
id String @id @default(uuid()) |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
User User @relation(fields: [userId], name: "accessGive", references: [id]) |
|
|
|
|
|
userId String |
|
|
userId String |
|
|
|
|
|
GranteeUser User? @relation("accessGet", fields: [granteeUserId], references: [id]) |
|
|
|
|
|
User User @relation("accessGive", fields: [userId], references: [id]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model Account { |
|
|
model Account { |
|
@ -27,12 +27,12 @@ model Account { |
|
|
id String @default(uuid()) |
|
|
id String @default(uuid()) |
|
|
isDefault Boolean @default(false) |
|
|
isDefault Boolean @default(false) |
|
|
name String? |
|
|
name String? |
|
|
Order Order[] |
|
|
|
|
|
Platform Platform? @relation(fields: [platformId], references: [id]) |
|
|
|
|
|
platformId String? |
|
|
platformId String? |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
userId String |
|
|
userId String |
|
|
|
|
|
Platform Platform? @relation(fields: [platformId], references: [id]) |
|
|
|
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
Order Order[] |
|
|
|
|
|
|
|
|
@@id([id, userId]) |
|
|
@@id([id, userId]) |
|
|
} |
|
|
} |
|
@ -40,8 +40,8 @@ model Account { |
|
|
model Analytics { |
|
|
model Analytics { |
|
|
activityCount Int @default(0) |
|
|
activityCount Int @default(0) |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
userId String @id |
|
|
userId String @id |
|
|
|
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model AuthDevice { |
|
|
model AuthDevice { |
|
@ -51,8 +51,8 @@ model AuthDevice { |
|
|
counter Int |
|
|
counter Int |
|
|
id String @id @default(uuid()) |
|
|
id String @id @default(uuid()) |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
userId String |
|
|
userId String |
|
|
|
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model MarketData { |
|
|
model MarketData { |
|
@ -64,11 +64,10 @@ model MarketData { |
|
|
marketPrice Float |
|
|
marketPrice Float |
|
|
|
|
|
|
|
|
@@unique([date, symbol]) |
|
|
@@unique([date, symbol]) |
|
|
@@index(fields: [symbol]) |
|
|
@@index([symbol]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model Order { |
|
|
model Order { |
|
|
Account Account? @relation(fields: [accountId, accountUserId], references: [id, userId]) |
|
|
|
|
|
accountId String? |
|
|
accountId String? |
|
|
accountUserId String? |
|
|
accountUserId String? |
|
|
comment String? |
|
|
comment String? |
|
@ -78,21 +77,22 @@ model Order { |
|
|
id String @id @default(uuid()) |
|
|
id String @id @default(uuid()) |
|
|
isDraft Boolean @default(false) |
|
|
isDraft Boolean @default(false) |
|
|
quantity Float |
|
|
quantity Float |
|
|
SymbolProfile SymbolProfile @relation(fields: [symbolProfileId], references: [id]) |
|
|
|
|
|
symbolProfileId String |
|
|
symbolProfileId String |
|
|
tags Tag[] |
|
|
|
|
|
type Type |
|
|
type Type |
|
|
unitPrice Float |
|
|
unitPrice Float |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
userId String |
|
|
userId String |
|
|
|
|
|
Account Account? @relation(fields: [accountId, accountUserId], references: [id, userId]) |
|
|
|
|
|
SymbolProfile SymbolProfile @relation(fields: [symbolProfileId], references: [id]) |
|
|
|
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
tags Tag[] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model Platform { |
|
|
model Platform { |
|
|
Account Account[] |
|
|
|
|
|
id String @id @default(uuid()) |
|
|
id String @id @default(uuid()) |
|
|
name String? |
|
|
name String? |
|
|
url String @unique |
|
|
url String @unique |
|
|
|
|
|
Account Account[] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model Property { |
|
|
model Property { |
|
@ -105,8 +105,8 @@ model Settings { |
|
|
settings Json? |
|
|
settings Json? |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
viewMode ViewMode? |
|
|
viewMode ViewMode? |
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
userId String @id |
|
|
userId String @id |
|
|
|
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model SymbolProfile { |
|
|
model SymbolProfile { |
|
@ -118,14 +118,14 @@ model SymbolProfile { |
|
|
dataSource DataSource |
|
|
dataSource DataSource |
|
|
id String @id @default(uuid()) |
|
|
id String @id @default(uuid()) |
|
|
name String? |
|
|
name String? |
|
|
Order Order[] |
|
|
|
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
scraperConfiguration Json? |
|
|
scraperConfiguration Json? |
|
|
sectors Json? |
|
|
sectors Json? |
|
|
symbol String |
|
|
symbol String |
|
|
symbolMapping Json? |
|
|
symbolMapping Json? |
|
|
SymbolProfileOverrides SymbolProfileOverrides? |
|
|
|
|
|
url String? |
|
|
url String? |
|
|
|
|
|
Order Order[] |
|
|
|
|
|
SymbolProfileOverrides SymbolProfileOverrides? |
|
|
|
|
|
|
|
|
@@unique([dataSource, symbol]) |
|
|
@@unique([dataSource, symbol]) |
|
|
} |
|
|
} |
|
@ -136,9 +136,9 @@ model SymbolProfileOverrides { |
|
|
countries Json? |
|
|
countries Json? |
|
|
name String? |
|
|
name String? |
|
|
sectors Json? |
|
|
sectors Json? |
|
|
SymbolProfile SymbolProfile @relation(fields: [symbolProfileId], references: [id]) |
|
|
|
|
|
symbolProfileId String @id |
|
|
symbolProfileId String @id |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
|
|
|
SymbolProfile SymbolProfile @relation(fields: [symbolProfileId], references: [id]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model Subscription { |
|
|
model Subscription { |
|
@ -146,8 +146,8 @@ model Subscription { |
|
|
expiresAt DateTime |
|
|
expiresAt DateTime |
|
|
id String @id @default(uuid()) |
|
|
id String @id @default(uuid()) |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
|
|
|
userId String |
|
|
userId String |
|
|
|
|
|
User User @relation(fields: [userId], references: [id]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model Tag { |
|
|
model Tag { |
|
@ -157,23 +157,23 @@ model Tag { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
model User { |
|
|
model User { |
|
|
Access Access[] @relation("accessGet") |
|
|
|
|
|
AccessGive Access[] @relation(name: "accessGive") |
|
|
|
|
|
accessToken String? |
|
|
accessToken String? |
|
|
Account Account[] |
|
|
|
|
|
alias String? |
|
|
alias String? |
|
|
Analytics Analytics? |
|
|
|
|
|
authChallenge String? |
|
|
authChallenge String? |
|
|
AuthDevice AuthDevice[] |
|
|
|
|
|
createdAt DateTime @default(now()) |
|
|
createdAt DateTime @default(now()) |
|
|
id String @id @default(uuid()) |
|
|
id String @id @default(uuid()) |
|
|
Order Order[] |
|
|
|
|
|
provider Provider @default(ANONYMOUS) |
|
|
provider Provider @default(ANONYMOUS) |
|
|
role Role @default(USER) |
|
|
role Role @default(USER) |
|
|
Settings Settings? |
|
|
|
|
|
Subscription Subscription[] |
|
|
|
|
|
thirdPartyId String? |
|
|
thirdPartyId String? |
|
|
updatedAt DateTime @updatedAt |
|
|
updatedAt DateTime @updatedAt |
|
|
|
|
|
Access Access[] @relation("accessGet") |
|
|
|
|
|
AccessGive Access[] @relation("accessGive") |
|
|
|
|
|
Account Account[] |
|
|
|
|
|
Analytics Analytics? |
|
|
|
|
|
AuthDevice AuthDevice[] |
|
|
|
|
|
Order Order[] |
|
|
|
|
|
Settings Settings? |
|
|
|
|
|
Subscription Subscription[] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
enum AccountType { |
|
|
enum AccountType { |
|
|