feat(teams): add Team model to Prisma schema
This commit is contained in:
@@ -130,6 +130,9 @@ model Person {
|
||||
email String?
|
||||
phone String?
|
||||
|
||||
teamId String? @db.Uuid
|
||||
team Team? @relation(fields: [teamId], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
||||
|
||||
userId String? @unique @db.Uuid
|
||||
user User? @relation(fields: [userId], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
||||
|
||||
@@ -141,9 +144,20 @@ model Person {
|
||||
|
||||
@@index([lastName, firstName])
|
||||
@@index([department, deletedAt])
|
||||
@@index([teamId, deletedAt])
|
||||
@@index([teamId])
|
||||
@@index([deletedAt])
|
||||
}
|
||||
|
||||
model Team {
|
||||
id String @id @default(uuid(7)) @db.Uuid
|
||||
name String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
people Person[]
|
||||
}
|
||||
|
||||
// ======================================================
|
||||
// CATALOG
|
||||
// ======================================================
|
||||
|
||||
Reference in New Issue
Block a user