-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
104 lines (91 loc) · 2.33 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 = "postgres"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["nApi"]
}
model Customer {
id String @id @default(cuid())
name String @unique
users User[]
devices Device[]
invites Invite[]
}
model User {
id String @id @default(cuid())
email String @unique
password String
type UserType @default(USER)
customerId String
customer Customer @relation(fields: [customerId], references: [id])
}
enum UserType {
USER
CONTACT
ADMIN
}
model Invite {
id String @id @default(cuid())
email String @unique
customerId String
customer Customer @relation(fields: [customerId], references: [id])
type UserType @default(USER)
createdAt DateTime @default(now())
}
model Device {
id String @id @default(cuid())
model String
brand String
image String
type DeviceType @default(STATIC)
customerId String
customer Customer @relation(fields: [customerId], references: [id])
interactions Interaction[]
manuals Manual[]
}
enum DeviceType {
STATIC
DYNAMIC
}
model Interaction {
id String @id @default(cuid())
type InteractionType
x Float
y Float
width Float
height Float
rotation Float
deviceId String
device Device @relation(fields: [deviceId], references: [id])
steps ManualStepInteraction[]
}
enum InteractionType {
SQUARE
CIRCLE
ANCHOR
}
model Manual {
id String @id @default(cuid())
title String
steps ManualStep[]
deviceId String
device Device @relation(fields: [deviceId], references: [id])
}
model ManualStep {
id String @id @default(cuid())
text String
order Int
manualId String
manual Manual @relation(fields: [manualId], references: [id])
interactions ManualStepInteraction[]
}
model ManualStepInteraction {
stepId String
step ManualStep @relation(fields: [stepId], references: [id])
interactionId String
interaction Interaction @relation(fields: [interactionId], references: [id])
color String
@@id([stepId, interactionId])
}