Skip to content

Instantly share code, notes, and snippets.

@nextdev1111
Created October 10, 2022 13:08
Show Gist options
  • Save nextdev1111/a62ac56f49d630634be2a6f6e20b6c8a to your computer and use it in GitHub Desktop.
Save nextdev1111/a62ac56f49d630634be2a6f6e20b6c8a to your computer and use it in GitHub Desktop.
Basic schema for postgresql database in prisma
// 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 Post {
id String @id @default(cuid())
text String
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
userId String
}
model User {
id String @id @default(uuid())
name String
posts Post[]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment