mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-22 22:54:22 +00:00
Create initial db schema
This commit is contained in:
parent
68429a1433
commit
28bcb79d2d
1 changed files with 52 additions and 1 deletions
|
@ -6,6 +6,57 @@ generator client {
|
||||||
}
|
}
|
||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "postgresql"
|
provider = "mysql"
|
||||||
url = env("DATABASE_URL")
|
url = env("DATABASE_URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// An event is the representation of a gathering of people in a certain place at a certain time.
|
||||||
|
model Event {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
//
|
||||||
|
slug String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
viewPassword String?
|
||||||
|
joinPassword String?
|
||||||
|
//
|
||||||
|
name String
|
||||||
|
description String
|
||||||
|
postcard String?
|
||||||
|
startTime DateTime?
|
||||||
|
endTime DateTime?
|
||||||
|
location String?
|
||||||
|
//
|
||||||
|
partecipants Partecipant[]
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A partecipant is a person who may or may not partecipate to the event.
|
||||||
|
model Partecipant {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
eventId Int
|
||||||
|
event Event @relation(fields: [eventId], references: [id])
|
||||||
|
//
|
||||||
|
name String
|
||||||
|
email String
|
||||||
|
//
|
||||||
|
means PartecipationMeans
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
joinedAt DateTime?
|
||||||
|
//
|
||||||
|
answer PartecipationAnswer
|
||||||
|
}
|
||||||
|
|
||||||
|
enum PartecipationMeans {
|
||||||
|
CREATOR
|
||||||
|
INVITED
|
||||||
|
ACCEPTED
|
||||||
|
JOINED
|
||||||
|
}
|
||||||
|
|
||||||
|
enum PartecipationAnswer {
|
||||||
|
HOST
|
||||||
|
YES
|
||||||
|
MAYBE
|
||||||
|
NO
|
||||||
|
PENDING
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue