add control-letter

This commit is contained in:
dpurbosakti
2025-11-03 15:17:11 +07:00
parent 149253b00f
commit 4749392788
5 changed files with 150 additions and 2 deletions

No files matched your search

@@ -0,0 +1,17 @@
-- Create "ControlLetter" table
CREATE TABLE "public"."ControlLetter" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Unit_Id" bigint NULL,
"Specialist_Id" bigint NULL,
"Subspecialist_Id" bigint NULL,
"Date" timestamptz NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ControlLetter_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ControlLetter_Specialist" FOREIGN KEY ("Specialist_Id") REFERENCES "public"."Specialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ControlLetter_Subspecialist" FOREIGN KEY ("Subspecialist_Id") REFERENCES "public"."Subspecialist" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ControlLetter_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);