Files
Lee RobinsonandGitHub fe312ed4bd Update MySQL example. (#34784)
Changes from https://github.com/planetscale/nextjs-starter.

Realized the current example was not only out of date, but the demo was broken. Will update the demo site post-merge here 👍
2022-02-25 03:41:41 +00:00

30 lines
687 B
Plaintext

generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
referentialIntegrity = "prisma"
}
model Product {
id Int @id @default(autoincrement())
name String
description String
price Decimal
image String
category Category? @relation(fields: [category_id], references: [id])
category_id Int
@@index([category_id])
}
model Category {
id Int @id @default(autoincrement())
name String
description String
products Product[]
}