This commit is contained in:
2026-09-30 09:53:05 +03:30
parent 5a2c4cabfd
commit 38cabb0957
19 changed files with 397 additions and 72 deletions
@@ -0,0 +1,8 @@
-- AlterTable
ALTER TABLE "Product" ADD COLUMN "brandId" TEXT;
-- CreateIndex
CREATE INDEX "Product_brandId_idx" ON "Product"("brandId");
-- AddForeignKey
ALTER TABLE "Product" ADD CONSTRAINT "Product_brandId_fkey" FOREIGN KEY ("brandId") REFERENCES "Brand"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1 @@
ALTER TABLE "InternalMessage" ADD COLUMN "link" TEXT;
+5
View File
@@ -214,11 +214,13 @@ model Product {
subtitle String?
rollMeters Float @default(50)
isNew Boolean @default(false)
brandId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
catalog Catalog @relation(fields: [catalogId], references: [id], onDelete: Cascade)
brand Brand? @relation(fields: [brandId], references: [id], onDelete: SetNull)
cartItems CartItem[]
orderItems OrderItem[]
favorites ProductFavorite[]
@@ -229,6 +231,7 @@ model Product {
@@unique([companyId, code])
@@index([catalogId])
@@index([companyId])
@@index([brandId])
@@index([usageCategory])
@@index([season])
}
@@ -585,6 +588,7 @@ model InternalMessage {
senderName String
subject String
preview String
link String?
isRead Boolean @default(false)
sentAt DateTime @default(now())
}
@@ -658,6 +662,7 @@ model Brand {
updatedAt DateTime @updatedAt
customers CustomerBrand[]
products Product[]
}
model CustomerBrand {