unreal-chat/apps/api/prisma/schema.prisma
Juan Sebastian Montoya 16731409df refactor: migrate from Next.js to SolidJS and GraphQL
- Converted web application from Next.js to SolidJS with Vite
- Replaced React components with SolidJS components
- Implemented GraphQL client using URQL
- Added authentication, room, and chat components
- Updated project structure and configuration files
- Removed unnecessary Next.js and docs-related files
- Added Docker support for web and API applications
2025-03-04 01:08:52 -05:00

50 lines
1.4 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"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
email String @unique
username String @unique
password String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
messages Message[]
rooms Room[] @relation("RoomMembers")
ownedRooms Room[] @relation("RoomOwner")
}
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
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])
}