-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
49 lines (43 loc) · 1.36 KB
/
schema.prisma
File metadata and controls
49 lines (43 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
email String @unique
password String
name String?
role String @default("user")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
wallet Wallet?
}
model Wallet {
id String @id @default(uuid())
userId String @unique
totalValue Float @default(0)
totalProfit Float @default(0)
rentability Float @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
items WalletItem[]
user User @relation(fields: [userId], references: [id])
}
model WalletItem {
id String @id @default(uuid())
walletId String
assetId String
quantity Float
avgBuyPrice Float
currentPrice Float
profit Float
wallet Wallet @relation(fields: [walletId], references: [id])
// assets Assets @relation(fields: [assetId], references: [id])
}