Skip to content

Instantly share code, notes, and snippets.

@kuccello
Created December 14, 2020 23:02
Show Gist options
  • Save kuccello/bcc75870df754080771d411493f2e582 to your computer and use it in GitHub Desktop.
Save kuccello/bcc75870df754080771d411493f2e582 to your computer and use it in GitHub Desktop.
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
email String @unique
name String?
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
published Boolean @default(false)
title String
author User? @relation(fields: [authorId], references: [id])
authorId Int?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment