From 9b7be9ca66fa9d492bba1449d908c59f48b5c159 Mon Sep 17 00:00:00 2001 From: vanilia Date: Tue, 11 Nov 2025 15:58:40 +0700 Subject: [PATCH] delete fk from encounter --- cmd/main-migration/migrations/20251111085815.sql | 2 ++ cmd/main-migration/migrations/atlas.sum | 3 ++- internal/domain/main-entities/encounter/entity.go | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 cmd/main-migration/migrations/20251111085815.sql diff --git a/cmd/main-migration/migrations/20251111085815.sql b/cmd/main-migration/migrations/20251111085815.sql new file mode 100644 index 00000000..945c7329 --- /dev/null +++ b/cmd/main-migration/migrations/20251111085815.sql @@ -0,0 +1,2 @@ +-- Modify "FileAttachment" table +ALTER TABLE "public"."FileAttachment" DROP CONSTRAINT "fk_Encounter_FileAttachments"; diff --git a/cmd/main-migration/migrations/atlas.sum b/cmd/main-migration/migrations/atlas.sum index ceca9be1..e1c7602d 100644 --- a/cmd/main-migration/migrations/atlas.sum +++ b/cmd/main-migration/migrations/atlas.sum @@ -1,4 +1,4 @@ -h1:/ysf2SIdpKcuSzvAPNWONxzu08MCf8eE5krteU4Chas= +h1:bPQtdFQustm+bzfbxrIgoD7sYhMS7+D4qaSmiyN6LUA= 20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k= 20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0= 20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI= @@ -109,3 +109,4 @@ h1:/ysf2SIdpKcuSzvAPNWONxzu08MCf8eE5krteU4Chas= 20251110100258.sql h1:IBqt1VZj5WjQ+l9aAFGHOCCBtzb03KlLLihFLut7itg= 20251110100545.sql h1:6/LV7751iyKxE2xI6vO1zly+aHUwxXD/IBwLcVpKxqM= 20251111040358.sql h1:c/RQSoA8yZl7cAcOv7n1RchmudPj7LdL3PEBdNvCUrA= +20251111085815.sql h1:zY86Sl4p7yLEHvn9oJTjsK+yo5HfF4LsPa+uRHzsAeU= diff --git a/internal/domain/main-entities/encounter/entity.go b/internal/domain/main-entities/encounter/entity.go index dc7c2781..c9e9bb95 100644 --- a/internal/domain/main-entities/encounter/entity.go +++ b/internal/domain/main-entities/encounter/entity.go @@ -9,7 +9,6 @@ import ( ed "simrs-vx/internal/domain/main-entities/doctor" eem "simrs-vx/internal/domain/main-entities/emergency" ee "simrs-vx/internal/domain/main-entities/employee" - efa "simrs-vx/internal/domain/main-entities/file-attachment" eip "simrs-vx/internal/domain/main-entities/inpatient" ei "simrs-vx/internal/domain/main-entities/insurance-company" eir "simrs-vx/internal/domain/main-entities/internal-reference" @@ -71,7 +70,6 @@ type Encounter struct { Inpatient *eip.Inpatient `json:"inpatient,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"` Rehab *er.Basic `json:"rehab,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"` RehabChildren *[]er.Basic `json:"rehabChildren,omitempty" gorm:"foreignKey:Parent_Encounter_Id;references:Id"` - FileAttachments *[]efa.FileAttachment `json:"fileAttachments,omitempty" gorm:"foreignKey:Ref_Id;references:Id"` } func (d Encounter) IsDone() bool {