fix: 清理重复服务并增加唯一约束

This commit is contained in:
que01 committed 2026-09-19 12:11:53 +08:00
1 parent 5ab8c34a78
commit a90a47f808
2 files changed
+3

No files matched your search

@@ -0,0 +1,2 @@
-- Prevent duplicate service names within one brand.
CREATE UNIQUE INDEX "Service_brandId_name_key" ON "Service"("brandId", "name");
+1
View File
@@ -67,6 +67,7 @@ model Service {
updatedAt DateTime @updatedAt
bookings Booking[]
bookingItems BookingItem[]
@@unique([brandId, name])
@@index([brandId, isEnabled, sortOrder])
}