33 lines
868 B
Plaintext
33 lines
868 B
Plaintext
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
|
|
}
|