feat: add Prisma schema (MySQL) and Docker Compose for db/redis
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6948fa61f2
commit
d5c9aa0be9
9 files changed
+1835
-9174
No files matched your search
@@ -0,0 +1,136 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "mysql"
|
||||
}
|
||||
|
||||
enum UserRole {
|
||||
admin
|
||||
user
|
||||
}
|
||||
|
||||
enum MeetingType {
|
||||
instant
|
||||
scheduled
|
||||
}
|
||||
|
||||
enum MeetingStatus {
|
||||
scheduled
|
||||
active
|
||||
ended
|
||||
}
|
||||
|
||||
enum ParticipantRole {
|
||||
host
|
||||
co_host
|
||||
participant
|
||||
}
|
||||
|
||||
enum ParticipantStatus {
|
||||
pending
|
||||
admitted
|
||||
denied
|
||||
left
|
||||
}
|
||||
|
||||
enum RecordingStatus {
|
||||
in_progress
|
||||
processing
|
||||
completed
|
||||
failed
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
email String @unique
|
||||
password String
|
||||
displayName String @map("display_name")
|
||||
role UserRole @default(user)
|
||||
emailVerifiedAt DateTime? @map("email_verified_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
hostedMeetings Meeting[] @relation("MeetingHost")
|
||||
meetingParticipant MeetingParticipant[]
|
||||
notes Note[]
|
||||
startedRecordings Recording[] @relation("RecordingStartedBy")
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
|
||||
model Meeting {
|
||||
id Int @id @default(autoincrement())
|
||||
uuid String @unique
|
||||
title String
|
||||
type MeetingType
|
||||
status MeetingStatus @default(scheduled)
|
||||
scheduledAt DateTime? @map("scheduled_at")
|
||||
hostUserId Int @map("host_user_id")
|
||||
startedAt DateTime? @map("started_at")
|
||||
endedAt DateTime? @map("ended_at")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
host User @relation("MeetingHost", fields: [hostUserId], references: [id])
|
||||
participants MeetingParticipant[]
|
||||
notes Note[]
|
||||
recordings Recording[]
|
||||
|
||||
@@index([uuid])
|
||||
@@map("meetings")
|
||||
}
|
||||
|
||||
model MeetingParticipant {
|
||||
id Int @id @default(autoincrement())
|
||||
meetingId Int @map("meeting_id")
|
||||
userId Int? @map("user_id")
|
||||
guestName String? @map("guest_name")
|
||||
identity String
|
||||
role ParticipantRole @default(participant)
|
||||
status ParticipantStatus @default(pending)
|
||||
requestedAt DateTime @default(now()) @map("requested_at")
|
||||
admittedAt DateTime? @map("admitted_at")
|
||||
leftAt DateTime? @map("left_at")
|
||||
|
||||
meeting Meeting @relation(fields: [meetingId], references: [id])
|
||||
user User? @relation(fields: [userId], references: [id])
|
||||
|
||||
@@unique([meetingId, identity])
|
||||
@@index([meetingId, status])
|
||||
@@map("meeting_participants")
|
||||
}
|
||||
|
||||
model Note {
|
||||
id Int @id @default(autoincrement())
|
||||
meetingId Int @map("meeting_id")
|
||||
userId Int @map("user_id")
|
||||
content String @db.Text
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
meeting Meeting @relation(fields: [meetingId], references: [id])
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
|
||||
@@unique([meetingId, userId])
|
||||
@@map("notes")
|
||||
}
|
||||
|
||||
model Recording {
|
||||
id Int @id @default(autoincrement())
|
||||
meetingId Int @map("meeting_id")
|
||||
egressId String @map("egress_id")
|
||||
status RecordingStatus @default(in_progress)
|
||||
storagePath String? @map("storage_path")
|
||||
fileSizeBytes BigInt? @map("file_size_bytes")
|
||||
durationSeconds Int? @map("duration_seconds")
|
||||
startedByUserId Int @map("started_by_user_id")
|
||||
startedAt DateTime @default(now()) @map("started_at")
|
||||
completedAt DateTime? @map("completed_at")
|
||||
|
||||
meeting Meeting @relation(fields: [meetingId], references: [id])
|
||||
startedBy User @relation("RecordingStartedBy", fields: [startedByUserId], references: [id])
|
||||
|
||||
@@map("recordings")
|
||||
}
|
||||
Reference in new issue
Block a user