chore: relation constraints
This commit is contained in:
parent
d639e5d4bf
commit
bb1e6cf38b
2 changed files with 27 additions and 4 deletions
|
|
@ -0,0 +1,23 @@
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "QuotationPaySplit" DROP CONSTRAINT "QuotationPaySplit_quotationId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "QuotationPayment" DROP CONSTRAINT "QuotationPayment_quotationId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "RequestData" DROP CONSTRAINT "RequestData_employeeId_fkey";
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "RequestData" DROP CONSTRAINT "RequestData_quotationId_fkey";
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "QuotationPayment" ADD CONSTRAINT "QuotationPayment_quotationId_fkey" FOREIGN KEY ("quotationId") REFERENCES "Quotation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "QuotationPaySplit" ADD CONSTRAINT "QuotationPaySplit_quotationId_fkey" FOREIGN KEY ("quotationId") REFERENCES "Quotation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "RequestData" ADD CONSTRAINT "RequestData_employeeId_fkey" FOREIGN KEY ("employeeId") REFERENCES "Employee"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "RequestData" ADD CONSTRAINT "RequestData_quotationId_fkey" FOREIGN KEY ("quotationId") REFERENCES "Quotation"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
@ -1158,7 +1158,7 @@ model QuotationPayment {
|
||||||
amount Float
|
amount Float
|
||||||
remark String?
|
remark String?
|
||||||
|
|
||||||
quotation Quotation @relation(fields: [quotationId], references: [id])
|
quotation Quotation @relation(fields: [quotationId], references: [id], onDelete: Cascade)
|
||||||
quotationId String
|
quotationId String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1169,7 +1169,7 @@ model QuotationPaySplit {
|
||||||
date DateTime @db.Date
|
date DateTime @db.Date
|
||||||
amount Float
|
amount Float
|
||||||
|
|
||||||
quotation Quotation? @relation(fields: [quotationId], references: [id])
|
quotation Quotation? @relation(fields: [quotationId], references: [id], onDelete: Cascade)
|
||||||
quotationId String?
|
quotationId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1222,10 +1222,10 @@ model QuotationProductServiceWorker {
|
||||||
model RequestData {
|
model RequestData {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
|
|
||||||
employee Employee @relation(fields: [employeeId], references: [id])
|
employee Employee @relation(fields: [employeeId], references: [id], onDelete: Cascade)
|
||||||
employeeId String
|
employeeId String
|
||||||
|
|
||||||
quotation Quotation @relation(fields: [quotationId], references: [id])
|
quotation Quotation @relation(fields: [quotationId], references: [id], onDelete: Cascade)
|
||||||
quotationId String
|
quotationId String
|
||||||
|
|
||||||
flow Json?
|
flow Json?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue