Some checks failed
Lint and Check Types / validations (push) Failing after 47s
- Added MINIO_PORT to .env.example for Minio configuration. - Updated package.json to include a script for Prisma generation. - Modified turbo.json to ensure db:generate task is executed during build and dev processes. - Updated CI workflow to run Prisma generate step. - Adjusted imports in the API to reference the generated Prisma client correctly. - Added .gitignore entry for Prisma client directory.
65 lines
2 KiB
Text
65 lines
2 KiB
Text
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
output = "./client"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
email String @unique
|
|
username String @unique
|
|
password String @db.Text
|
|
s3ProfilePicObjectKey String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
messages Message[]
|
|
rooms Room[] @relation("RoomMembers")
|
|
ownedRooms Room[] @relation("RoomOwner")
|
|
refreshTokens RefreshToken[]
|
|
}
|
|
|
|
model Room {
|
|
id String @id @default(uuid())
|
|
name String
|
|
description String?
|
|
isPrivate Boolean @default(false)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
messages Message[]
|
|
members User[] @relation("RoomMembers")
|
|
ownerId String
|
|
owner User @relation("RoomOwner", fields: [ownerId], references: [id])
|
|
}
|
|
|
|
model Message {
|
|
id String @id @default(uuid())
|
|
content String @db.Text
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id])
|
|
roomId String
|
|
room Room @relation(fields: [roomId], references: [id])
|
|
}
|
|
|
|
model RefreshToken {
|
|
id String @id @default(uuid())
|
|
jti String @unique
|
|
userId String
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
deviceId String
|
|
hash String
|
|
expiresAt DateTime
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|