feat(db): add 4 reference models with initial migrations
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
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[]
|
||||
|
||||
@@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])
|
||||
|
||||
@@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")
|
||||
}
|
||||
Reference in New Issue
Block a user