generator client { provider = "prisma-client-js" } datasource db { provider = "mysql" url = "mysql://root:diocane@localhost:3306/chewer" } // A source to get information from model Source { id Int @id @default(autoincrement()) name String description String? image Json? type SourceType @default(FEED) link String? URL String @unique status Status @default(OK) nErrors Int @default(0) lastError String? updatedAt DateTime @updatedAt createdAt DateTime @default(now()) cohorts Cohort[] posts Post[] } model Tag { name String @id posts Post[] } // generic post model Post { id Int @id @default(autoincrement()) date DateTime @default(now()) updatedAt DateTime @updatedAt title String URL String @unique content String @db.Text summary String @default("") source Source @relation(fields: [sourceId], references: [id]) tags Tag[] sourceId Int } model Cohort { id Int @id @default(autoincrement()) name String @unique sources Source[] dailyViews Int? @default(0) } enum SourceType { FEED } enum Status { OK WARNING ERROR }