feat(db): add Materiel, Accessoire and MaterielAccessoire models
This commit is contained in:
@@ -17,6 +17,7 @@ model Campus {
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
utilisateurs Utilisateur[]
|
||||
sallesPret SallePret[]
|
||||
materiels Materiel[]
|
||||
|
||||
@@map("campus")
|
||||
}
|
||||
@@ -56,7 +57,8 @@ model CategorieMateriel {
|
||||
description String
|
||||
actif Boolean @default(true)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
materiels Materiel[]
|
||||
|
||||
@@map("categorie_materiel")
|
||||
}
|
||||
@@ -101,3 +103,49 @@ model CarteEtudiante {
|
||||
|
||||
@@map("carte_etudiante")
|
||||
}
|
||||
|
||||
model Materiel {
|
||||
id Int @id @default(autoincrement())
|
||||
nom String
|
||||
marque String
|
||||
modele String
|
||||
reference String
|
||||
numeroInventaire String @map("numero_inventaire")
|
||||
numeroSerie String @map("numero_serie")
|
||||
statut String
|
||||
etatGeneral String @map("etat_general")
|
||||
categorieId Int @map("categorie_id")
|
||||
campusId Int @map("campus_id")
|
||||
actif Boolean @default(true)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
categorie CategorieMateriel @relation(fields: [categorieId], references: [id])
|
||||
campus Campus @relation(fields: [campusId], references: [id])
|
||||
accessoires MaterielAccessoire[]
|
||||
|
||||
@@map("materiel")
|
||||
}
|
||||
|
||||
model Accessoire {
|
||||
id Int @id @default(autoincrement())
|
||||
nom String
|
||||
description String
|
||||
actif Boolean @default(true)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
materiels MaterielAccessoire[]
|
||||
|
||||
@@map("accessoire")
|
||||
}
|
||||
|
||||
model MaterielAccessoire {
|
||||
id Int @id @default(autoincrement())
|
||||
materielId Int @map("materiel_id")
|
||||
accessoireId Int @map("accessoire_id")
|
||||
quantiteAttendue Int @map("quantite_attendue")
|
||||
obligatoire Boolean
|
||||
materiel Materiel @relation(fields: [materielId], references: [id])
|
||||
accessoire Accessoire @relation(fields: [accessoireId], references: [id])
|
||||
|
||||
@@map("materiel_accessoire")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user