mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-07-09 15:08:06 +00:00
Update schema.prisma
Took 24 minutes
This commit is contained in:
+31
-23
@@ -10,20 +10,19 @@ datasource db {
|
|||||||
|
|
||||||
// Models
|
// Models
|
||||||
model User {
|
model User {
|
||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
email String @unique
|
email String @unique
|
||||||
password String
|
password String
|
||||||
firstName String?
|
firstName String?
|
||||||
lastName String?
|
lastName String?
|
||||||
bio String?
|
bio String?
|
||||||
location String?
|
location String?
|
||||||
images String[]
|
images String[]
|
||||||
birthdate DateTime?
|
birthdate DateTime?
|
||||||
gender Gender @default(UNKNOWN)
|
gender Gender @default(UNKNOWN)
|
||||||
role Role @default(USER)
|
role Role @default(USER)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @default(now())
|
updatedAt DateTime @updatedAt
|
||||||
lastConnexion DateTime @default(now())
|
|
||||||
|
|
||||||
// Liste des chats de l'utilisateur
|
// Liste des chats de l'utilisateur
|
||||||
ChatID String[] @db.ObjectId
|
ChatID String[] @db.ObjectId
|
||||||
@@ -51,21 +50,28 @@ model User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model Notification {
|
model Notification {
|
||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
type NotificationType
|
type NotificationType
|
||||||
UserId String @db.ObjectId
|
createdAt DateTime @default(now())
|
||||||
User User @relation(fields: [UserId], references: [id])
|
hasBeenConsulted Boolean @default(false)
|
||||||
|
|
||||||
|
UserId String @db.ObjectId
|
||||||
|
User User @relation(fields: [UserId], references: [id])
|
||||||
}
|
}
|
||||||
|
|
||||||
model Match {
|
model Match {
|
||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
UserId String[] @db.ObjectId
|
UserId String[] @db.ObjectId
|
||||||
User User[] @relation(fields: [UserId], references: [id])
|
User User[] @relation(fields: [UserId], references: [id])
|
||||||
}
|
}
|
||||||
|
|
||||||
model Passion {
|
model Passion {
|
||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
name String
|
name String
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
// Les utilisateurs qui on en commun cette passion
|
// Les utilisateurs qui on en commun cette passion
|
||||||
UserId String[] @db.ObjectId
|
UserId String[] @db.ObjectId
|
||||||
@@ -73,8 +79,9 @@ model Passion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model Chat {
|
model Chat {
|
||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
messages Message[]
|
messages Message[]
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
// Les utilisateurs qui ont un chat en commun
|
// Les utilisateurs qui ont un chat en commun
|
||||||
User User[] @relation(fields: [UserId], references: [id])
|
User User[] @relation(fields: [UserId], references: [id])
|
||||||
@@ -85,6 +92,7 @@ model Message {
|
|||||||
id String @id @default(auto()) @map("_id") @db.ObjectId
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
||||||
message String
|
message String
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
|
updatedAt DateTime @updatedAt
|
||||||
|
|
||||||
// L'utilisateur qui a envoyé le message
|
// L'utilisateur qui a envoyé le message
|
||||||
UserID String @db.ObjectId
|
UserID String @db.ObjectId
|
||||||
|
|||||||
Reference in New Issue
Block a user