2022-07-25 17:22:59 +00:00
|
|
|
// 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 = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
model Comic {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
slug String @unique
|
|
|
|
title String
|
|
|
|
url String
|
|
|
|
pages ComicPage[]
|
|
|
|
characters ComicCharacter[]
|
|
|
|
}
|
|
|
|
|
|
|
|
model ComicPage {
|
|
|
|
id Int
|
2022-07-26 21:02:44 +00:00
|
|
|
comic Comic @relation(fields: [comicId], references: [id])
|
2022-07-25 17:22:59 +00:00
|
|
|
comicId Int
|
|
|
|
title String
|
|
|
|
url String
|
|
|
|
imageUrl String
|
|
|
|
width Int
|
|
|
|
height Int
|
2022-07-26 21:02:44 +00:00
|
|
|
bubbles ComicBubble[]
|
|
|
|
|
|
|
|
lastEditedBy User? @relation(fields: [lastEditedById], references: [id])
|
|
|
|
lastEditedById String?
|
2022-07-25 17:22:59 +00:00
|
|
|
|
|
|
|
@@id([comicId, id])
|
|
|
|
@@unique([comicId, id])
|
|
|
|
}
|
|
|
|
|
|
|
|
model ComicCharacter {
|
2022-07-26 21:02:44 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
comic Comic @relation(fields: [comicId], references: [id])
|
2022-07-25 17:22:59 +00:00
|
|
|
comicId Int
|
|
|
|
shortName String
|
2022-07-26 21:02:44 +00:00
|
|
|
longName String @unique
|
|
|
|
bubbles ComicBubble[]
|
2022-07-25 17:22:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model ComicBubble {
|
2022-07-26 21:02:44 +00:00
|
|
|
comicId Int
|
|
|
|
page ComicPage @relation(fields: [comicId, pageId], references: [comicId, id])
|
|
|
|
pageId Int
|
|
|
|
idx Int
|
2022-07-25 17:22:59 +00:00
|
|
|
|
2022-07-26 21:02:44 +00:00
|
|
|
character ComicCharacter @relation(fields: [characterId], references: [id])
|
2022-07-25 17:22:59 +00:00
|
|
|
characterId Int
|
|
|
|
|
2022-07-26 21:02:44 +00:00
|
|
|
areaX Int
|
|
|
|
areaY Int
|
|
|
|
areaWidth Int
|
2022-07-25 17:22:59 +00:00
|
|
|
areaHeight Int
|
|
|
|
|
|
|
|
content String
|
|
|
|
|
|
|
|
@@id([comicId, pageId, idx])
|
|
|
|
@@unique([comicId, pageId, idx])
|
|
|
|
}
|
2022-07-26 14:32:57 +00:00
|
|
|
|
|
|
|
// User authentication
|
|
|
|
|
|
|
|
model Account {
|
|
|
|
id String @id @default(cuid())
|
|
|
|
userId String
|
|
|
|
type String
|
|
|
|
provider String
|
|
|
|
providerAccountId String
|
|
|
|
refresh_token String?
|
|
|
|
refresh_expires_in Int?
|
|
|
|
access_token String?
|
|
|
|
expires_at Int?
|
|
|
|
token_type String?
|
|
|
|
scope String?
|
|
|
|
id_token String?
|
|
|
|
session_state String?
|
|
|
|
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
|
|
|
|
@@unique([provider, providerAccountId])
|
|
|
|
}
|
|
|
|
|
|
|
|
model Session {
|
|
|
|
id String @id @default(cuid())
|
|
|
|
sessionToken String @unique
|
|
|
|
userId String
|
|
|
|
expires DateTime
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
}
|
|
|
|
|
|
|
|
model User {
|
2022-07-26 21:02:44 +00:00
|
|
|
id String @id @default(cuid())
|
2022-07-26 14:32:57 +00:00
|
|
|
name String?
|
2022-07-26 21:02:44 +00:00
|
|
|
email String? @unique
|
2022-07-26 14:32:57 +00:00
|
|
|
emailVerified DateTime?
|
|
|
|
image String?
|
|
|
|
accounts Account[]
|
|
|
|
sessions Session[]
|
2022-07-26 21:02:44 +00:00
|
|
|
|
|
|
|
lastEditedPages ComicPage[]
|
2022-07-26 14:32:57 +00:00
|
|
|
}
|