rename table to internal reference

This commit is contained in:
vanilia
2025-10-13 15:20:24 +07:00
parent 378fd93b2d
commit 8abead652f
4 changed files with 23 additions and 6 deletions
@@ -0,0 +1,16 @@
-- Create "InternalReference" table
CREATE TABLE "public"."InternalReference" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Unit_Id" integer NULL,
"Doctor_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_InternalReference_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_InternalReference_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_InternalReference_Unit" FOREIGN KEY ("Unit_Id") REFERENCES "public"."Unit" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Drop "CheckoutPolies" table
DROP TABLE "public"."CheckoutPolies";