add doctor id into device-order, material-order, add fk parent and childrens for infra

This commit is contained in:
dpurbosakti
2025-10-03 10:21:18 +07:00
parent 6d50ca233a
commit 200c3e9c83
6 changed files with 18 additions and 3 deletions

No files matched your search

@@ -0,0 +1,6 @@
-- Modify "Infra" table
ALTER TABLE "public"."Infra" ADD CONSTRAINT "fk_Infra_Childrens" FOREIGN KEY ("Parent_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "DeviceOrder" table
ALTER TABLE "public"."DeviceOrder" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_DeviceOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
-- Modify "MaterialOrder" table
ALTER TABLE "public"."MaterialOrder" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_MaterialOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;