You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
// 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 = "postgresql"
|
|
|
|
url = env("DATABASE_URL")
|
|
|
|
}
|
|
|
|
|
|
|
|
model User {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
email String @unique
|
|
|
|
admin Boolean @default(false)
|
|
|
|
password String
|
|
|
|
name String
|
|
|
|
posts Post[]
|
|
|
|
links Link[]
|
|
|
|
}
|
|
|
|
|
|
|
|
model Post {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
title String
|
|
|
|
content String?
|
|
|
|
published Boolean @default(false)
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
tags String[]
|
|
|
|
|
|
|
|
author User @relation(fields: [authorId], references: [id])
|
|
|
|
authorId Int
|
|
|
|
}
|
|
|
|
|
|
|
|
model Link {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
remoteAddress String
|
|
|
|
location String
|
|
|
|
|
|
|
|
author User @relation(fields: [authorId], references: [id])
|
|
|
|
authorId Int
|
|
|
|
}
|