Skip to content

Commit 89f52fd

Browse files
committed
prisma: Added schema.dbml file
1 parent 34ce785 commit 89f52fd

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

prisma/schema.dbml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
//// ------------------------------------------------------
2+
//// THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
3+
//// ------------------------------------------------------
4+
5+
Table Account {
6+
id Int [pk, increment]
7+
userId Int [not null]
8+
provider String [not null]
9+
providerAccountId String [not null]
10+
user User [not null]
11+
12+
indexes {
13+
(provider, providerAccountId) [unique]
14+
}
15+
}
16+
17+
Table User {
18+
id Int [pk, increment]
19+
name String [not null]
20+
email String [unique, not null]
21+
phone String
22+
role UserRole [not null]
23+
refreshToken String
24+
accounts Account [not null]
25+
Booking Booking [not null]
26+
}
27+
28+
Table Booking {
29+
id Int [pk, increment]
30+
from DateTime [not null]
31+
to DateTime [not null]
32+
createdAt DateTime [default: `now()`, not null]
33+
updatedAt DateTime [default: `now()`, not null]
34+
status BookingStatus [not null]
35+
userId Int [not null]
36+
serviceId Int [not null]
37+
service Service [not null]
38+
user User [not null]
39+
}
40+
41+
Table Service {
42+
id Int [pk, increment]
43+
name String [not null]
44+
description String [not null]
45+
price Int [not null]
46+
createdAt DateTime [default: `now()`, not null]
47+
updatedAt DateTime [default: `now()`, not null]
48+
status ServiceStatus [not null, default: 'ACTIVE']
49+
locationId Int
50+
Booking Booking [not null]
51+
location Location
52+
ServiceSchedule ServiceSchedule [not null]
53+
}
54+
55+
Table ServiceSchedule {
56+
id Int [pk, increment]
57+
day Int [not null]
58+
startTime String
59+
endTime String
60+
serviceId Int [not null]
61+
service Service [not null]
62+
63+
indexes {
64+
(serviceId, day) [unique]
65+
}
66+
}
67+
68+
Table Location {
69+
id Int [pk, increment]
70+
city String [not null]
71+
address String [not null]
72+
country String [not null]
73+
lat Float
74+
lng Float
75+
Service Service [not null]
76+
}
77+
78+
Enum UserRole {
79+
ADMIN
80+
MANAGER
81+
USER
82+
}
83+
84+
Enum BookingStatus {
85+
CONFIRMED
86+
PENDING
87+
CANCELLED
88+
}
89+
90+
Enum ServiceStatus {
91+
ACTIVE
92+
INACTIVE
93+
UNAVAILABLE
94+
DRAFT
95+
ARCHIVED
96+
}
97+
98+
Ref: Account.userId > User.id [delete: Cascade]
99+
100+
Ref: Booking.serviceId > Service.id [delete: Cascade]
101+
102+
Ref: Booking.userId > User.id [delete: Cascade]
103+
104+
Ref: Service.locationId > Location.id
105+
106+
Ref: ServiceSchedule.serviceId > Service.id [delete: Cascade]

0 commit comments

Comments
 (0)