Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into fix/anything-moko
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
-- Modify "Infra" table
|
||||
ALTER TABLE "public"."Infra" ADD CONSTRAINT "fk_Infra_Childrens" FOREIGN KEY ("Parent_Id") REFERENCES "public"."Infra" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Modify "DeviceOrder" table
|
||||
ALTER TABLE "public"."DeviceOrder" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_DeviceOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
-- Modify "MaterialOrder" table
|
||||
ALTER TABLE "public"."MaterialOrder" ADD COLUMN "Doctor_Id" bigint NULL, ADD CONSTRAINT "fk_MaterialOrder_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
@@ -1,4 +1,4 @@
|
||||
h1:jZ9sh96fN1qtT2OItPgP+Anzvi92I1twBDGmU2RWlVU=
|
||||
h1:EkXfc/qeBa+6Fog89GGHEbrpjWfLwy/t6MQdrP9tImE=
|
||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||
@@ -22,3 +22,4 @@ h1:jZ9sh96fN1qtT2OItPgP+Anzvi92I1twBDGmU2RWlVU=
|
||||
20250930025550.sql h1:+F+CsCUXD/ql0tHGEow70GhPBX1ZybVn+bh/T4YMh7Y=
|
||||
20250930140351.sql h1:9AAEG1AnOAH+o0+oHL5G7I8vqlWOhwRlCGyyCpT/y1Q=
|
||||
20251002085604.sql h1:3xZ68eYp4urXRnvotNH1XvG2mYOSDV/j3zHEZ/txg5E=
|
||||
20251003032030.sql h1:hdN6UINPM9Pz9ME6uP3pr6PNCqqz4y7h2qY1UlVjw60=
|
||||
|
||||
@@ -2,6 +2,7 @@ package deviceorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
@@ -11,6 +12,8 @@ type DeviceOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,6 @@ type Division struct {
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent *Division `gorm:"foreignKey:Parent_Id;references:Id"`
|
||||
Childrens []Division `gorm:"foreignKey:Parent_Id"` // may need references to self
|
||||
Parent *Division `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
|
||||
Childrens []Division `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ type Infra struct {
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
InfraGroup_Code ero.InfraGroupCode `json:"infraGroup_code" gorm:"size:10"`
|
||||
Parent_Id *uint16 `json:"parent_id"`
|
||||
Parent *Infra `json:"parent" gorm:"foreignKey:Parent_Id;references:Id"`
|
||||
Childrens []Infra `json:"childrens" gorm:"foreignKey:Parent_Id"` // may need references to self
|
||||
Item_Id *uint `json:"item_id"`
|
||||
Item *ei.Item `json:"item,omitempty" gorm:"foreignKey:Item_Id;references:Id"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package materialorder
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
ed "simrs-vx/internal/domain/main-entities/doctor"
|
||||
ee "simrs-vx/internal/domain/main-entities/encounter"
|
||||
|
||||
erc "simrs-vx/internal/domain/references/common"
|
||||
@@ -11,6 +12,8 @@ type MaterialOrder struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Encounter_Id *uint `json:"encounter_id"`
|
||||
Encounter *ee.Encounter `json:"encounter,omitempty" gorm:"foreignKey:Encounter_Id;references:Id"`
|
||||
Doctor_Id *uint `json:"doctor_id"`
|
||||
Doctor *ed.Doctor `json:"doctor,omitempty" gorm:"foreignKey:Doctor_Id;references:Id"`
|
||||
Status_Code erc.DataStatusCode `json:"status_code"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user