95 lines
2.5 KiB
Plaintext
95 lines
2.5 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
username String @unique
|
|
password String
|
|
createdAt DateTime @default(now())
|
|
}
|
|
|
|
model Branch {
|
|
id String @id @default(uuid())
|
|
name String
|
|
address String?
|
|
phone String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
classes DanceClass[]
|
|
lessons Lesson[]
|
|
students Student[]
|
|
instructors Instructor[] @relation("BranchToInstructor")
|
|
}
|
|
|
|
model Instructor {
|
|
id String @id @default(uuid())
|
|
name String
|
|
bio String?
|
|
phone String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
classes DanceClass[]
|
|
lessons Lesson[]
|
|
branches Branch[] @relation("BranchToInstructor")
|
|
}
|
|
|
|
model DanceClass {
|
|
id String @id @default(uuid())
|
|
name String
|
|
description String?
|
|
branchId String
|
|
instructorId String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
instructor Instructor? @relation(fields: [instructorId], references: [id])
|
|
branch Branch @relation(fields: [branchId], references: [id])
|
|
fees Fee[]
|
|
lessons Lesson[]
|
|
}
|
|
|
|
model Lesson {
|
|
id String @id @default(uuid())
|
|
name String?
|
|
startTime DateTime
|
|
endTime DateTime
|
|
type String
|
|
branchId String
|
|
instructorId String
|
|
classId String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
class DanceClass? @relation(fields: [classId], references: [id])
|
|
instructor Instructor @relation(fields: [instructorId], references: [id])
|
|
branch Branch @relation(fields: [branchId], references: [id])
|
|
}
|
|
|
|
model Fee {
|
|
id String @id @default(uuid())
|
|
name String
|
|
amount Float
|
|
currency String @default("TRY")
|
|
type String
|
|
classId String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
class DanceClass? @relation(fields: [classId], references: [id])
|
|
}
|
|
|
|
model Student {
|
|
id String @id @default(uuid())
|
|
name String
|
|
email String?
|
|
phone String
|
|
birthDate DateTime
|
|
branchId String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
branch Branch? @relation(fields: [branchId], references: [id])
|
|
}
|