chew/prisma/schema.prisma

65 lines
1.5 KiB
Text

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = "mysql://root:diocane@localhost:3306/chewer"
}
model Cohort {
id Int @id @default(autoincrement())
name String @unique
dailyView Int @default(0)
description String?
sources Source[]
}
model Post {
id Int @id @default(autoincrement())
date DateTime @default(now())
updatedAt DateTime? @updatedAt
title String @default("")
content String? @db.Text
summary String? @db.Text
URL String @unique
image String? @db.VarChar(250)
sourceId Int
tags Tag[]
source Source @relation(fields: [sourceId], references: [id])
// @@index([sourceId], map: "Post_sourceId_fkey")
}
model Tag {
id Int @id @default(autoincrement())
name String @unique
posts Post[]
}
model Source {
id Int @id @default(autoincrement())
name String
type Source_type @default(FEED)
URL String @unique
updatedAt DateTime? @default(now())
createdAt DateTime @default(now())
lastError String?
status Source_status @default(OK)
nErrors Int @default(0)
description String?
image String? @db.LongText
link String?
posts Post[]
cohorts Cohort[]
}
enum Source_type {
FEED
}
enum Source_status {
OK
WARNING
ERROR
}