Files
2025-12-06 09:54:05 +07:00

27 lines
1.2 KiB
SQL

-- Create "ProcedureReport" table
CREATE TABLE "public"."ProcedureReport" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Date" timestamptz NOT NULL,
"Doctor_Code" character varying(10) NULL,
"Operator_Name" text NULL,
"Assistant_Name" text NULL,
"Instrumentor_Name" text NULL,
"Diagnose" character varying(1024) NULL,
"Nurse_Name" character varying(10) NULL,
"Anesthesia_Doctor_Code" character varying(10) NULL,
"Anesthesia_Nurse_Name" text NULL,
"ProcedureValue" text NULL,
"ExecutionValue" text NULL,
"Type_Code" text NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_ProcedureReport_Anesthesia_Doctor" FOREIGN KEY ("Anesthesia_Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ProcedureReport_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_ProcedureReport_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);
-- Drop "ActionReport" table
DROP TABLE "public"."ActionReport";