-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
116 lines (110 loc) · 3.5 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
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
binaryTargets = "native"
}
// Define your own datamodels here and run `yarn redwood prisma migrate dev`
// to create migrations for them and apply to your dev DB.
model Event {
id String @id @default(uuid())
// key public metadata
name String
description String?
timezone String @default("America/New_York")
startAt DateTime
endAt DateTime
// location info
venueType EventVenueType @default(IN_PERSON)
venueName String?
address String?
country String?
city String?
stateOrProvince String?
postalCode String?
// registration fields
registrationStartAt DateTime
registrationEndAt DateTime
currency String @default("USD")
capacity Int?
// general timestamps
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
// relationships
sessions EventSession[]
speakers EventSpeaker[]
registrants EventRegistrant[]
}
model EventRegistrant {
id String @id @default(uuid())
// metadata
email String
firstName String
lastName String
displayName String?
jobTitle String?
company String?
profilePicture String?
dateOfBirth DateTime @db.Date
language String @default("en-US")
// internal admin fields
ipAddress String
notes String?
// general timestamps
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
cancelledAt DateTime?
checkedInAt DateTime?
// relationships
event Event @relation(fields: [eventId], references: [id])
eventId String
sessions EventSession[]
speaker EventSpeaker?
}
model EventSession {
id String @id @default(uuid())
// key public metadata
name String
description String?
startAt DateTime
endAt DateTime
capacity Int?
// general timestamps
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
// relationships
event Event @relation(fields: [eventId], references: [id])
eventId String
speaker EventSpeaker? @relation(fields: [eventSpeakerId], references: [id])
eventSpeakerId String?
registrants EventRegistrant[]
}
model EventSpeaker {
id String @id @default(uuid())
firstName String
lastName String
jobTitle String?
company String?
profilePicture String?
bio String
dateOfBirth DateTime @db.Date
language String @default("en-US")
// internal admin fields
ipAddress String
// general timestamps
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
// relationships
event Event @relation(fields: [eventId], references: [id])
eventId String
sessions EventSession[]
registrant EventRegistrant? @relation(fields: [registrantId], references: [id])
registrantId String? @unique
}
enum EventVenueType {
IN_PERSON
ONLINE
HYBRID
}