complete the following prisma models
// 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"
output = "../generated/prisma"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
// ================
model Account {
// --- Core Identification ---
id String @id @default(ulid())
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// --- Virtual Relationships ---
personalAccount PersonalAccount?
professionalAccount ProfessionalAccount?
businessAccount BusinessAccount?
wallet Wallet?
memberships Membership[]
}
model PersonalAccount {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
account Account @relation(fields: [accountId], references: [id])
accountId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model ProfessionalAccount {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
account Account @relation(fields: [accountId], references: [id])
accountId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model BusinessAccount {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
account Account @relation(fields: [accountId], references: [id])
accountId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ================
model Wallet {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
account Account @relation(fields: [accountId], references: [id])
accountId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ================
model Group {
// --- Core Identification ---
id String @id @default(ulid())
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// --- Virtual Relationships ---
memberships Membership[]
}
model Membership {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
group Group @relation(fields: [groupId], references: [id])
groupId String
account Account @relation(fields: [accountId], references: [id])
accountId String
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([groupId, accountId])
}
// ================
model Page {
// --- Core Identification ---
id String @id @default(ulid())
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// --- Virtual Relationships ---
schoolPage SchoolPage?
drivingSchoolPage DrivingSchoolPage?
reviewCenterPage ReviewCenterPage?
}
model SchoolPage {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
page Page @relation(fields: [pageId], references: [id])
pageId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model DrivingSchoolPage {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
page Page @relation(fields: [pageId], references: [id])
pageId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model ReviewCenterPage {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
page Page @relation(fields: [pageId], references: [id])
pageId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ================
model Post {
// --- Core Identification ---
id String @id @default(ulid())
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// --- Virtual Relationships ---
deletedPost DeletedPost?
textPost TextPost?
linkPost LinkPost?
pollPost PollPost?
questionPost QuestionPost?
jobPost JobPost?
comments Comment[]
reports Report[]
reactions Reaction[]
responses Response[]
}
model DeletedPost {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model TextPost {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model LinkPost {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model PollPost {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model QuestionPost {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model JobPost {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ================
model Comment {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
// --- Virtual Relationships ---
replies Reply[]
}
model Reply {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
comment Comment @relation(fields: [commentId], references: [id])
commentId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ================
model Attachment {
id String @id @default(ulid())
}
model Topic {
id String @id @default(ulid())
}
// ================
model Report {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ================
model Reaction {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Response {
// --- Core Identification ---
id String @id @default(ulid())
// --- Relationships ---
post Post @relation(fields: [postId], references: [id])
postId String @unique
// --- Timestamps ---
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ================
model Notification {
id String @id @default(ulid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}