diff --git a/cmd/main-migration/migrations/20251201104439.sql b/cmd/main-migration/migrations/20251201104439.sql index 50f60b6b..832d10e2 100644 --- a/cmd/main-migration/migrations/20251201104439.sql +++ b/cmd/main-migration/migrations/20251201104439.sql @@ -1,5 +1,5 @@ --- Create "ActionReport" table -CREATE TABLE "public"."ActionReport" ( +-- Create "ProcedureReport" table +CREATE TABLE "public"."ProcedureReport" ( "Id" bigserial NOT NULL, "CreatedAt" timestamptz NULL, "UpdatedAt" timestamptz NULL, @@ -7,13 +7,23 @@ CREATE TABLE "public"."ActionReport" ( "Encounter_Id" bigint NULL, "Date" character varying(20) NOT NULL, "Doctor_Code" character varying(10) NULL, - "Operator_Employe_Id" bigint NULL, - "Assistant_Employe_Id" bigint NULL, - "Instrumentor_Employe_Id" bigint NULL, + "Operator_Name" character varying(120) NULL, + "Assistant_Name" character varying(120) NULL, + "Instrumentor_Name" character varying(120) NULL, "Diagnose" character varying(1024) NULL, - "Procedures" character varying(10240) NULL, - "Nurse_Code" character varying(10) NULL, - "Value" text NULL, + "Nurse_Name" character varying(120) NULL, + "ProcedureValue" text NULL, + "ExecutionValue" text NULL, + "Type" character varying(10) NULL, PRIMARY KEY ("Id"), - CONSTRAINT "fk_ActionReport_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") 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 ); + +-- PROPER + -- "Operator_Employe_Id" bigint NULL, + -- "Assistant_Employe_Id" bigint NULL, + -- "Instrumentor_Employe_Id" bigint NULL, + -- "Diagnose" character varying(1024) NULL, + -- "Procedures" character varying(10240) NULL, + -- "Nurse_Code" character varying(10) NULL, + diff --git a/cmd/main-migration/migrations/20251201113804.sql b/cmd/main-migration/migrations/20251201113804.sql index 0f5c5123..8cecb5fe 100644 --- a/cmd/main-migration/migrations/20251201113804.sql +++ b/cmd/main-migration/migrations/20251201113804.sql @@ -1,2 +1,2 @@ --- Modify "ActionReport" table -ALTER TABLE "public"."ActionReport" DROP COLUMN "Date", DROP COLUMN "Procedures"; +-- Modify "ProcedureReport" table +ALTER TABLE "public"."ProcedureReport" DROP COLUMN "Date", DROP COLUMN "Procedures"; diff --git a/cmd/main-migration/migrations/20251201113858.sql b/cmd/main-migration/migrations/20251201113858.sql index fd6fddc9..bc77d02c 100644 --- a/cmd/main-migration/migrations/20251201113858.sql +++ b/cmd/main-migration/migrations/20251201113858.sql @@ -1,2 +1,2 @@ --- Modify "ActionReport" table -ALTER TABLE "public"."ActionReport" ADD COLUMN "Date" timestamptz NOT NULL; +-- Modify "ProcedureReport" table +ALTER TABLE "public"."ProcedureReport" ADD COLUMN "Date" timestamptz NOT NULL; diff --git a/cmd/main-migration/migrations/20251201114751.sql b/cmd/main-migration/migrations/20251201114751.sql index 6611b811..339ee39c 100644 --- a/cmd/main-migration/migrations/20251201114751.sql +++ b/cmd/main-migration/migrations/20251201114751.sql @@ -1,2 +1,2 @@ --- Modify "ActionReport" table -ALTER TABLE "public"."ActionReport" ADD CONSTRAINT "fk_ActionReport_Instrumentor_Employe" FOREIGN KEY ("Instrumentor_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ActionReport_Nurse" FOREIGN KEY ("Nurse_Code") REFERENCES "public"."Nurse" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ActionReport_Operator_Employe" FOREIGN KEY ("Operator_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION; +-- Modify "ProcedureReport" table +ALTER TABLE "public"."ProcedureReport" ADD CONSTRAINT "fk_ProcedureReport_Instrumentor_Employe" FOREIGN KEY ("Instrumentor_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ProcedureReport_Nurse" FOREIGN KEY ("Nurse_Code") REFERENCES "public"."Nurse" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION, ADD CONSTRAINT "fk_ProcedureReport_Operator_Employe" FOREIGN KEY ("Operator_Employe_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION; diff --git a/cmd/main-migration/migrations/20251201114913.sql b/cmd/main-migration/migrations/20251201114913.sql index 5155ed37..85c0281c 100644 --- a/cmd/main-migration/migrations/20251201114913.sql +++ b/cmd/main-migration/migrations/20251201114913.sql @@ -1,2 +1,2 @@ --- Modify "ActionReport" table -ALTER TABLE "public"."ActionReport" ADD CONSTRAINT "fk_ActionReport_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION; +-- Modify "ProcedureReport" table +ALTER TABLE "public"."ProcedureReport" ADD CONSTRAINT "fk_ProcedureReport_Doctor" FOREIGN KEY ("Doctor_Code") REFERENCES "public"."Doctor" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION;