Created
October 10, 2022 13:08
-
-
Save nextdev1111/a62ac56f49d630634be2a6f6e20b6c8a to your computer and use it in GitHub Desktop.
Basic schema for postgresql database in prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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