updateweb
This commit is contained in:
41
backend/prisma/schema.prisma
Normal file
41
backend/prisma/schema.prisma
Normal file
@@ -0,0 +1,41 @@
|
||||
// Prisma Schema
|
||||
// Database schema definition and ORM configuration
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = "postgresql://skyartapp:SkyArt2025Pass@localhost:5432/skyartshop?schema=public"
|
||||
}
|
||||
|
||||
// User model
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
email String @unique
|
||||
password String
|
||||
role String @default("customer") // 'admin' or 'customer'
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
|
||||
// Product model
|
||||
model Product {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
description String @db.Text
|
||||
price Decimal @db.Decimal(10, 2)
|
||||
category String
|
||||
stock Int @default(0)
|
||||
images String[] // Array of image URLs
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@map("products")
|
||||
}
|
||||
|
||||
// Add more models as needed
|
||||
Reference in New Issue
Block a user