102 lines
2.5 KiB
Plaintext
102 lines
2.5 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
output = "../src/generated/prisma"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Utilisateur {
|
|
ut_id Int @id @default(autoincrement())
|
|
ut_nom String?
|
|
ut_prenom String?
|
|
ut_mail String?
|
|
ut_type_cliente Int?
|
|
ut_age DateTime?
|
|
ut_nb_rdv Int?
|
|
ut_nb_rdv_honores Int?
|
|
ut_prix_moyen Int?
|
|
ut_pdp Int?
|
|
ut_panier Int?
|
|
ut_mdp Int?
|
|
ut_telephone Int?
|
|
ut_date_inscription DateTime @default(now())
|
|
ut_derniere_connexion DateTime?
|
|
commande Commande[]
|
|
achat Achat[]
|
|
}
|
|
|
|
model Formation {
|
|
fo_id Int @id @default(autoincrement())
|
|
fo_titre String?
|
|
fo_description String?
|
|
fo_prix String?
|
|
fo_miniature Bytes?
|
|
fo_teaser String?
|
|
fo_date_publication DateTime @default(now())
|
|
fo_video Video[]
|
|
commandeFormation CommandeFormation[]
|
|
achat Achat[]
|
|
}
|
|
|
|
model Video{
|
|
formation Formation @relation(fields: [vi_fo_id],references: [fo_id], onDelete: Cascade)
|
|
vi_fo_id Int
|
|
vi_id Int @id @default(autoincrement())
|
|
vi_titre String?
|
|
vi_description String?
|
|
vi_etape Int?
|
|
vi_url String?
|
|
vi_tv TagVideo[]
|
|
}
|
|
|
|
model Commande{
|
|
co_id Int @id @default(autoincrement())
|
|
co_utilisateur Int
|
|
utilisateur Utilisateur @relation(fields: [co_utilisateur],references: [ut_id])
|
|
co_date_creation DateTime @default(now())
|
|
co_date_update DateTime?
|
|
co_status String @default("IN PROGRESS")
|
|
}
|
|
|
|
model CommandeFormation{
|
|
cof_id Int @id @default(autoincrement())
|
|
cof_formation Int
|
|
formation Formation @relation(fields: [cof_formation],references: [fo_id])
|
|
}
|
|
|
|
model Achat{
|
|
ac_id Int @id @default(autoincrement())
|
|
ac_utilisateur Int
|
|
utilisateur Utilisateur @relation(fields: [ac_utilisateur],references: [ut_id])
|
|
ac_formation Int
|
|
formation Formation @relation(fields: [ac_formation],references: [fo_id])
|
|
ac_type String?
|
|
ac_date_achat DateTime?
|
|
ac_date_fin DateTime?
|
|
}
|
|
|
|
model Tag {
|
|
ta_id Int @id @default(autoincrement())
|
|
ta_titre String?
|
|
vi_tv TagVideo[]
|
|
}
|
|
|
|
model TagVideo{
|
|
@@id([tv_tag_id, tv_video_id])
|
|
tv_tag_id Int
|
|
tag Tag @relation(fields: [tv_tag_id],references: [ta_id], onDelete: Cascade)
|
|
tv_video_id Int
|
|
video Video @relation(fields: [tv_video_id],references: [vi_id], onDelete: Cascade)
|
|
|
|
}
|
|
|