49 lines
No EOL
1.1 KiB
Text
49 lines
No EOL
1.1 KiB
Text
// 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"
|
|
}
|
|
|
|
generator pothos {
|
|
provider = "prisma-pothos-types"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "sqlite"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
email String? @unique
|
|
name String
|
|
posts Post[]
|
|
sessions Session[]
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
}
|
|
|
|
model Session {
|
|
id Int @id @default(autoincrement())
|
|
expiresAt DateTime
|
|
sessionToken String @unique
|
|
accessToken String @unique
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
userId Int
|
|
user User @relation(references: [id], fields: [userId])
|
|
}
|
|
|
|
|
|
model Post {
|
|
id Int @id @default(autoincrement())
|
|
title String
|
|
content String
|
|
published Boolean? @default(false)
|
|
author User @relation(fields: [authorId], references: [id])
|
|
authorId Int
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @default(now()) @updatedAt
|
|
} |