This repository has been archived by the owner on Mar 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
166 lines (153 loc) · 4.51 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = "native"
previewFeatures = ["interactiveTransactions"]
}
model ShopUserBelonging{
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
shopId String @db.Uuid
userId String @unique
shop Shop @relation(fields: [shopId], references: [id])
user User @relation(fields: [userId], references: [userId])
isDeleted Boolean
createdAt DateTime @default(now())
}
model OrganizationShopBelonging{
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
organizationId String @db.Uuid
shopId String @db.Uuid
shop Shop @relation(fields: [shopId], references: [id])
organization Organization @relation(fields: [organizationId], references: [id])
isDeleted Boolean
createdAt DateTime @default(now())
}
model Organization {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
organizationName String
shop OrganizationShopBelonging[]
temporaryClosed TemporaryClosed[]
announce Announce[]
isDeleted Boolean
createdAt DateTime @default(now())
}
model Shop {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
shopName String
openTime String
closeTime String
timeUnit Int
submitFrequency String
avatar String
useTimeCard Boolean
organization OrganizationShopBelonging[]
user ShopUserBelonging[]
operation Operation[]
stableShift StableShift[]
unstableShift UnstableShift[]
request Request[]
timeCard TimeCard[]
temporaryClosed TemporaryClosed[]
announce Announce[]
isDeleted Boolean
createdAt DateTime @default(now())
}
model User {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
userId String @unique
userName String
avatar String
role String
email String
shop ShopUserBelonging[]
stableShift StableShift[]
unstableShift UnstableShift[]
request Request[]
timeCard TimeCard[]
isDeleted Boolean
createdAt DateTime @default(now())
}
model Operation {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
shopId String @db.Uuid
operationName String
icon String
color String
shop Shop @relation(fields: [shopId], references: [id])
isDeleted Boolean
createdAt DateTime @default(now())
}
model StableShift {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
shopId String @db.Uuid
userId String @unique
workFrom DateTime
workTo DateTime
breakFrom DateTime
breakTo DateTime
shop Shop @relation(fields: [shopId], references: [id])
user User @relation(fields: [userId], references: [userId])
isDeleted Boolean
createdAt DateTime @default(now())
}
model UnstableShift {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
shopId String @db.Uuid
userId String @unique
workFrom DateTime
workTo DateTime
breakFrom DateTime
breakTo DateTime
shop Shop @relation(fields: [shopId], references: [id])
user User @relation(fields: [userId], references: [userId])
isDeleted Boolean
createdAt DateTime @default(now())
}
model Request{
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
shopId String @db.Uuid
userId String @unique
dateFrom DateTime
dateTo DateTime
done Boolean
shop Shop @relation(fields: [shopId], references: [id])
user User @relation(fields: [userId], references: [userId])
isDeleted Boolean
createdAt DateTime @default(now())
}
model TimeCard{
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
shopId String @db.Uuid
userId String @unique
workFrom DateTime
workTo DateTime
breakFrom DateTime
breakTo DateTime
shop Shop @relation(fields: [shopId], references: [id])
user User @relation(fields: [userId], references: [userId])
isDeleted Boolean
createdAt DateTime @default(now())
}
model TemporaryClosed {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
organizationId String @db.Uuid
shopId String @db.Uuid
date DateTime
organization Organization @relation(fields: [organizationId], references: [id])
shop Shop @relation(fields: [shopId], references: [id])
isDeleted Boolean
createdAt DateTime @default(now())
}
model Announce {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
organizationId String @db.Uuid
shopId String @db.Uuid
message String
organization Organization @relation(fields: [organizationId], references: [id])
shop Shop @relation(fields: [shopId], references: [id])
isDeleted Boolean
createdAt DateTime @default(now())
}