From a70e53f6f6f5bf4e1012fdc969169d8378d2dfdf Mon Sep 17 00:00:00 2001 From: vanilia Date: Fri, 31 Oct 2025 15:47:18 +0700 Subject: [PATCH] update entity --- cmd/main-migration/migrations/20251031084657.sql | 13 +++++++++++++ cmd/main-migration/migrations/atlas.sum | 5 +++-- internal/interface/migration/main-entities.go | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 cmd/main-migration/migrations/20251031084657.sql diff --git a/cmd/main-migration/migrations/20251031084657.sql b/cmd/main-migration/migrations/20251031084657.sql new file mode 100644 index 00000000..30974d75 --- /dev/null +++ b/cmd/main-migration/migrations/20251031084657.sql @@ -0,0 +1,13 @@ +-- Create "Rehab" table +CREATE TABLE "public"."Rehab" ( + "Id" bigserial NOT NULL, + "CreatedAt" timestamptz NULL, + "UpdatedAt" timestamptz NULL, + "DeletedAt" timestamptz NULL, + "Encounter_Id" bigint NULL, + "Doctor_Id" bigint NULL, + "AllocatedVisitCount" bigint NULL, + PRIMARY KEY ("Id"), + CONSTRAINT "fk_Rehab_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "fk_Rehab_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION +); diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index ab2219c2..a851d5ed 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:kXjsrZJU3k4a8nz9SfvetshAm8PQpUM0zww0P+9BhRU= +h1:llqBiqOQF+QcCuZSeEWKfRzAd9gN8gE4uGgdKWkfGW4= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -62,4 +62,5 @@ h1:kXjsrZJU3k4a8nz9SfvetshAm8PQpUM0zww0P+9BhRU= 20251025013609.sql h1:evPJaTD8WxYRMOJZHkSr7ONLx9PYxT+ankzQt9c/sJ0= 20251027075128.sql h1:/iFQBM1sytjqpyQSOx61q33gnorMgxTiFVSuL6bQqsM= 20251027091406.sql h1:eCZGtUkxAzEAqpC9UsGpP8Df9mS0DEOqSl885LgqpvM= -20251031082443.sql h1:4CJ16kx1tbtG3ycNTTu7di725Q9zL1FNgEozs+JGlwk= +20251031082443.sql h1:ajvi2G8OGvcmB2pJ1SoX/09ALHLWKNh84RSonVhJqAc= +20251031084657.sql h1:rsml3HJP+sXmciMBIkowwkyabKFWuQTci2lDjnf5km0= diff --git a/internal/interface/migration/main-entities.go b/internal/interface/migration/main-entities.go index 6507202e..a46b27dd 100644 --- a/internal/interface/migration/main-entities.go +++ b/internal/interface/migration/main-entities.go @@ -73,6 +73,7 @@ import ( proceduresrc "simrs-vx/internal/domain/main-entities/procedure-src" province "simrs-vx/internal/domain/main-entities/province" regency "simrs-vx/internal/domain/main-entities/regency" + rehab "simrs-vx/internal/domain/main-entities/rehab" responsibledoctorhist "simrs-vx/internal/domain/main-entities/responsible-doctor-hist" room "simrs-vx/internal/domain/main-entities/room" sbar "simrs-vx/internal/domain/main-entities/sbar" @@ -193,5 +194,6 @@ func getMainEntities() []any { &responsibledoctorhist.ResponsibleDoctorHist{}, &admemployeehist.AdmEmployeeHist{}, &vclaimmember.VclaimMember{}, + &rehab.Rehab{}, } }