init project
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
/// Категория изделий (игрушки, сувениры и т.д.)
|
||||
model Category {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
slug String @unique
|
||||
sort Int @default(0)
|
||||
products Product[]
|
||||
}
|
||||
|
||||
model Product {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
slug String @unique
|
||||
description String?
|
||||
/// Цена в копейках (целое число, без дробной части)
|
||||
priceCents Int
|
||||
imageUrl String?
|
||||
published Boolean @default(false)
|
||||
category Category @relation(fields: [categoryId], references: [id], onDelete: Cascade)
|
||||
categoryId String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
Reference in New Issue
Block a user