104 lines
3.2 KiB
Plaintext
104 lines
3.2 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlserver"
|
|
}
|
|
|
|
model Campus {
|
|
id Int @id @default(autoincrement())
|
|
nom String
|
|
adresse String
|
|
ville String
|
|
codePostal String @map("code_postal")
|
|
actif Boolean @default(true)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
utilisateurs Utilisateur[]
|
|
sallesPret SallePret[]
|
|
|
|
@@map("campus")
|
|
}
|
|
|
|
model Role {
|
|
id Int @id @default(autoincrement())
|
|
code String @unique
|
|
libelle String
|
|
description String
|
|
utilisateurs Utilisateur[]
|
|
|
|
@@map("role")
|
|
}
|
|
|
|
model Utilisateur {
|
|
id Int @id @default(autoincrement())
|
|
microsoftId String @unique @map("microsoft_id")
|
|
nom String
|
|
prenom String
|
|
email String @unique
|
|
classe String?
|
|
roleId Int @map("role_id")
|
|
campusId Int @map("campus_id")
|
|
actif Boolean @default(true)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
campus Campus @relation(fields: [campusId], references: [id])
|
|
role Role @relation(fields: [roleId], references: [id])
|
|
cartes CarteEtudiante[]
|
|
|
|
@@map("utilisateur")
|
|
}
|
|
|
|
model CategorieMateriel {
|
|
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")
|
|
|
|
@@map("categorie_materiel")
|
|
}
|
|
|
|
model SallePret {
|
|
id Int @id @default(autoincrement())
|
|
nom String
|
|
localisation String
|
|
campusId Int @map("campus_id")
|
|
actif Boolean @default(true)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
campus Campus @relation(fields: [campusId], references: [id])
|
|
postes PosteEmprunt[]
|
|
|
|
@@map("salle_pret")
|
|
}
|
|
|
|
model PosteEmprunt {
|
|
id Int @id @default(autoincrement())
|
|
nom String
|
|
identifiantPoste String @map("identifiant_poste")
|
|
sallePretId Int @map("salle_pret_id")
|
|
actif Boolean @default(true)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
sallePret SallePret @relation(fields: [sallePretId], references: [id])
|
|
|
|
@@map("poste_emprunt")
|
|
}
|
|
|
|
model CarteEtudiante {
|
|
id Int @id @default(autoincrement())
|
|
utilisateurId Int @map("utilisateur_id")
|
|
qrCode String @map("qr_code")
|
|
dateActivation DateTime @map("date_activation")
|
|
dateExpiration DateTime @map("date_expiration")
|
|
actif Boolean @default(true)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
utilisateur Utilisateur @relation(fields: [utilisateurId], references: [id])
|
|
|
|
@@map("carte_etudiante")
|
|
}
|