-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
104 lines (93 loc) · 2.62 KB
/
schema.prisma
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
// previewFeatures = []
}
generator dbml {
provider = "prisma-dbml-generator"
}
model User {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
email String @unique
password String
firstname String?
lastname String?
posts Post[]
role Role
}
model Post {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
published Boolean
title String
content String?
author User? @relation(fields: [authorId], references: [id])
authorId String?
}
enum Role {
ADMIN
USER
}
model AssetType {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
type String
data String
nft Boolean
asset Asset?
}
model Asset {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
type AssetType @relation(fields: [typeId], references: [id])
typeId String
value String
makeOrder Order? @relation("make")
takeOrder Order? @relation("take")
}
model Part {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
account String
value String
payoutsOrderData OrderData @relation("payouts", fields: [payoutsOrderDataId], references: [id])
payoutsOrderDataId String
originFeesOrderData OrderData @relation("originFees", fields: [originFeesOrderDataId], references: [id])
originFeesOrderDataId String
}
model OrderData {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
payouts Part[] @relation("payouts")
originFees Part[] @relation("originFees")
isMakeFill Boolean
Order Order?
}
model Order {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
maker String
taker String?
make Asset @relation("make", fields: [makeId], references: [id])
makeId String
take Asset @relation("take", fields: [takeId], references: [id])
takeId String
salt String
hash String
start DateTime
end DateTime
orderData OrderData @relation(fields: [orderDataId], references: [id])
orderDataId String
signature String?
}