savage-tracking/prisma/schema.prisma

54 lines
1.1 KiB
Text
Raw Normal View History

2023-12-21 08:24:14 -08:00
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
2023-12-21 08:24:25 -08:00
model User {
2023-12-21 08:24:14 -08:00
id Int @id @default(autoincrement())
2023-12-21 08:24:25 -08:00
grade Int?
class String?
2023-12-21 08:24:14 -08:00
name String
2023-12-21 08:24:25 -08:00
username String @unique
password String
isAdmin Boolean @default(false)
periods Period[]
number Int?
2023-12-21 08:24:14 -08:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([name])
}
2023-12-21 08:24:25 -08:00
model TimePeriod {
id Int @id
name String
periods Period[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([id])
}
model Period {
id Int @id @default(autoincrement())
date DateTime
timePeriod TimePeriod @relation(fields: [timePeriodId], references: [id])
timePeriodId Int
users User[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([date])
}