mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-25 06:01:10 +10:00
fix: refactor prisma multifolder into docs example
This commit is contained in:
21
prisma/models/news.prisma
Normal file
21
prisma/models/news.prisma
Normal file
@ -0,0 +1,21 @@
|
||||
model Tag {
|
||||
id String @id @default(uuid())
|
||||
name String @unique
|
||||
|
||||
articles Article[]
|
||||
}
|
||||
|
||||
model Article {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
description String
|
||||
content String @db.Text
|
||||
|
||||
tags Tag[]
|
||||
|
||||
image String? // Object ID
|
||||
publishedAt DateTime @default(now())
|
||||
|
||||
author User? @relation(fields: [authorId], references: [id]) // Optional, if no user, it's a system post
|
||||
authorId String?
|
||||
}
|
||||
Reference in New Issue
Block a user