add doctor_id in control-letter

This commit is contained in:
dpurbosakti
2025-11-04 15:10:33 +07:00
parent 5ebd74ff5e
commit 98a567a5b3
3 changed files with 9 additions and 3 deletions
@@ -0,0 +1,2 @@
-- Modify "ControlLetter" table
ALTER TABLE "public"."ControlLetter" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_ControlLetter_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
+4 -3
View File
@@ -1,4 +1,4 @@
h1:DapfqgPn4h3ozXgxIdxW/bzPLHdc//0uHjK+W42/jic=
h1:2J5umJFoWClM/F8kKNyZFoDqrV1aL8PimwTG6Mx6syo=
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
@@ -65,5 +65,6 @@ h1:DapfqgPn4h3ozXgxIdxW/bzPLHdc//0uHjK+W42/jic=
20251102002037.sql h1:lFJbuoZ2LMQnUNGdcwHVY3Xlfslgzu9t2WByT8yfOZI=
20251102091932.sql h1:rmdhb5m+P+fU8jROBZNyeYgZKuQvucsuljXv4ZVzvks=
20251103081637.sql h1:tf3BcwTeIw+oxMEisKDDfyKnBfalTLs8b0PJA8JWYxY=
20251104042334.sql h1:a76eSmiEVviWWjsfAkiriDxRYGhlg8qIjZ2CVQZDnbA=
20251104043530.sql h1:tGP1AhyYzPZAA05IwfJfWWhNISrud3xCmeRFdZ/28SQ=
20251104042334.sql h1:7PDMWOhmJywolAPKFZ14XaDBeMvcxShaXFN2IemNtzk=
20251104043530.sql h1:qvYVp3ysPf27f1BcoRNCFGovxuVE12lg9d6Xzda6zWU=
20251104080952.sql h1:+SMRSBPjP0qeLlaiIdff7hUnW2+1l1GJOWjP7fWPiGA=
@@ -4,6 +4,7 @@ import (
"time"
ecore "simrs-vx/internal/domain/base-entities/core"
ed "simrs-vx/internal/domain/main-entities/doctor"
ee "simrs-vx/internal/domain/main-entities/encounter"
es "simrs-vx/internal/domain/main-entities/specialist"
ess "simrs-vx/internal/domain/main-entities/subspecialist"
@@ -20,5 +21,7 @@ type ControlLetter struct {
Specialist *es.Specialist `json:"specialist" gorm:"foreignKey:Specialist_Id;references:Id"`
Subspecialist_Id *uint `json:"subspecialist_id"`
Subspecialist *ess.Subspecialist `json:"subspecialist" gorm:"foreignKey:Subspecialist_Id;references:Id"`
Doctor_Id *uint `json:"doctor_id"`
Doctor *ed.Doctor `json:"doctor" gorm:"foreignKey:Doctor_Id;references:Id"`
Date *time.Time `json:"date"`
}