Created
April 3, 2021 23:35
-
-
Save kuc-arc-f/8ce490b04f5a3f669d9bd59978ee8375 to your computer and use it in GitHub Desktop.
prisma / mysql schema file
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 | |
datasource db { | |
provider = "mysql" | |
url = env("DATABASE_URL") | |
} | |
generator client { | |
provider = "prisma-client-js" | |
} | |
model Post { | |
id Int @default(autoincrement()) @id | |
createdAt DateTime @default(now()) | |
updatedAt DateTime @updatedAt | |
title String @db.VarChar(255) | |
content String? | |
published Boolean @default(false) | |
author User @relation(fields: [authorId], references: [id]) | |
authorId Int | |
} | |
model Profile { | |
id Int @default(autoincrement()) @id | |
bio String? | |
user User @relation(fields: [userId], references: [id]) | |
userId Int @unique | |
} | |
model User { | |
id Int @default(autoincrement()) @id | |
email String @unique | |
name String? | |
posts Post[] | |
profile Profile? | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment