56 lines
1.2 KiB
Plaintext
56 lines
1.2 KiB
Plaintext
|
// 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"
|
||
|
}
|
||
|
|
||
|
datasource db {
|
||
|
provider = "sqlite"
|
||
|
url = "file:./dev.db"
|
||
|
}
|
||
|
|
||
|
model Story {
|
||
|
id Int @id @default(autoincrement())
|
||
|
word_count Int
|
||
|
title String
|
||
|
deleted Int @default(0)
|
||
|
subs Sub[]
|
||
|
genres Genre[]
|
||
|
}
|
||
|
|
||
|
model Pub {
|
||
|
id Int @id @default(autoincrement())
|
||
|
title String
|
||
|
link String @default("")
|
||
|
query_after_days Int
|
||
|
deleted Int @default(0)
|
||
|
subs Sub[]
|
||
|
genres Genre[]
|
||
|
}
|
||
|
|
||
|
model Genre {
|
||
|
id Int @id @default(autoincrement())
|
||
|
name String @unique
|
||
|
stories Story[]
|
||
|
pubs Pub[]
|
||
|
}
|
||
|
|
||
|
model Response {
|
||
|
id Int @id @default(autoincrement())
|
||
|
response String
|
||
|
subs Sub[]
|
||
|
}
|
||
|
|
||
|
model Sub {
|
||
|
id Int @id @default(autoincrement())
|
||
|
story Story @relation(fields: [storyId], references: [id])
|
||
|
storyId Int
|
||
|
pub Pub @relation(fields: [pubId], references: [id])
|
||
|
pubId Int
|
||
|
submitted String
|
||
|
responded String
|
||
|
response Response @relation(fields: [responseId], references: [id])
|
||
|
responseId Int
|
||
|
}
|