feat: 保存咨询提交的业务来源
This commit is contained in:
1 parent
4754230e5b
commit
25bf980d3c
5 files changed
+24
-1
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
ALTER TABLE "InquirySubmission" ADD COLUMN "offeringId" TEXT;
|
||||
ALTER TABLE "InquirySubmission"
|
||||
ADD CONSTRAINT "InquirySubmission_offeringId_fkey"
|
||||
FOREIGN KEY ("offeringId") REFERENCES "Offering"("id")
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
CREATE INDEX "InquirySubmission_offeringId_idx" ON "InquirySubmission"("offeringId");
|
||||
|
||||
UPDATE "InquirySubmission" s
|
||||
SET "offeringId" = f."offeringId"
|
||||
FROM "InquiryForm" f
|
||||
WHERE s."inquiryFormId" = f."id" AND f."offeringId" IS NOT NULL;
|
||||
@@ -127,6 +127,7 @@ model Offering {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
inquiryForms InquiryForm[]
|
||||
inquirySubmissions InquirySubmission[]
|
||||
bookings Booking[]
|
||||
bookingItems BookingItem[]
|
||||
@@unique([brandId, name])
|
||||
@@ -156,8 +157,10 @@ model InquirySubmission {
|
||||
id String @id @default(uuid())
|
||||
brandId String
|
||||
inquiryFormId String
|
||||
offeringId String?
|
||||
brand BrandProfile @relation(fields: [brandId], references: [id], onDelete: Cascade)
|
||||
inquiryForm InquiryForm @relation(fields: [inquiryFormId], references: [id], onDelete: Restrict)
|
||||
offering Offering? @relation(fields: [offeringId], references: [id], onDelete: SetNull)
|
||||
formVersion Int
|
||||
fieldsSnapshot Json
|
||||
values Json
|
||||
|
||||
Reference in new issue
Block a user