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[] tags Tag[] } model Post { id Int @id @default(autoincrement()) date DateTime @default(now()) updatedAt DateTime? @updatedAt title String content String? @db.Text summary String? @db.Text sourceId Int URL String @unique image String? source Source @relation(fields: [sourceId], references: [id]) tags Tag[] @@index([sourceId], map: "Post_sourceId_fkey") } 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[] } model Tag { name String @id cohorts Cohort[] posts Post[] } enum Source_type { FEED } enum Source_status { OK WARNING ERROR }