-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ee9e62
commit ef0ac5d
Showing
3 changed files
with
246 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model Category { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
products Product[] | ||
} | ||
|
||
model HeroImage { | ||
id Int @id @default(autoincrement()) | ||
image1 String | ||
image2 String | ||
} | ||
|
||
model Product { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
description String | ||
slug String @unique | ||
price Float | ||
priceId String @map("price_id") | ||
categoryId Int | ||
category Category @relation(fields: [categoryId], references: [id]) | ||
images Image[] | ||
} | ||
|
||
model Image { | ||
id Int @id @default(autoincrement()) | ||
url String | ||
productId Int | ||
product Product @relation(fields: [productId], references: [id]) | ||
} |