-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathschema.prisma
128 lines (101 loc) · 2.71 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
generator typegraphql {
provider = "typegraphql-prisma"
output = "../node_modules/@generated/type-graphql"
}
model OfferItem {
id String @id @default(cuid())
itemType Int
token String
identifierOrCriteria String
startAmount String
endAmount String
order Order @relation(fields: [orderHash], references: [hash], onDelete: Cascade)
orderHash String
}
model ConsiderationItem {
id String @id @default(cuid())
itemType Int
token String
identifierOrCriteria String
startAmount String
endAmount String
recipient String
order Order @relation(fields: [orderHash], references: [hash], onDelete: Cascade)
orderHash String
}
model Order {
hash String @id @unique
offer OfferItem[]
consideration ConsiderationItem[]
offerer String
signature String
orderType Int
startTime Int
endTime Int
counter Int
salt String
conduitKey String
zone String
zoneHash String
// Basic Order
additionalRecipients String? /// comma-separated
// Advanced Order
numerator String?
denominator String?
extraData String?
// Metadata
chainId String /// string decimal
metadata OrderMetadata?
auctionType Int /// 0: basic, 1: english, 2: dutch
}
model OrderMetadata {
orderHash String @id
createdAt DateTime @default(now())
isValid Boolean
isFullyFulfilled Boolean
lastFulfilledAt String?
lastFulfilledPrice String?
isPinned Boolean @default(false)
isRemoved Boolean @default(false)
lastValidatedBlockNumber String?
lastValidatedBlockHash String?
order Order @relation(fields: [orderHash], references: [hash], onDelete: Cascade)
}
model NodeStatus {
chainId String @id /// string decimal
ethRPCRequestsSentInCurrentUTCDay Int @default(0)
startOfCurrentUTCDay DateTime @default(now())
}
model Criteria {
hash String @id
tokenIds String /// comma-separated within field, with starting and ending commas for queries %like% ',tokenId,'
token String /// token address for the criteria (for more efficient querying)
}
model PeerStore {
key String @id
data Bytes
}
model DHT {
key String @id
data Bytes
}
model EthHeaders {
hash String @id
number String
parent String
timestamp DateTime
logs Bytes
}
model ERC20TokenPrices {
token String @id /// address, or 'NATIVE'
usdPricePerToken String
chainId String /// decimal string
updatedAt DateTime @updatedAt
}