Merge branch 'migration' of github.com:dikstub-rssa/simrs-be into fix/anything-moko
This commit is contained in:
+2
-2
@@ -27,8 +27,8 @@ go.work.sum
|
||||
# env file
|
||||
.env
|
||||
config.yml
|
||||
cmd/main-migration/atlas.hcl
|
||||
cmd/satusehat-migration/atlas.hcl
|
||||
**/atlas.hcl
|
||||
!**/atlas.hcl.example
|
||||
|
||||
# Editor/IDE
|
||||
# .idea/
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
-- Modify "Division" table
|
||||
ALTER TABLE "public"."Division" ALTER COLUMN "Parent_Id" TYPE integer, ADD CONSTRAINT "fk_Division_Childrens" FOREIGN KEY ("Parent_Id") REFERENCES "public"."Division" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION;
|
||||
@@ -1,4 +1,4 @@
|
||||
h1:X7LbOLpbDhciJ1O92KiWgnrVP60dDAyBKJqQKJnom+M=
|
||||
h1:kkT6c88mNI2KVSF5h2r1qdgxouqRlqt6scn0lhxl9+Q=
|
||||
20250904105930.sql h1:MEM6blCgke9DzWQSTnLzasbPIrcHssNNrJqZpSkEo6k=
|
||||
20250904141448.sql h1:J8cmYNk4ZrG9fhfbi2Z1IWz7YkfvhFqTzrLFo58BPY0=
|
||||
20250908062237.sql h1:Pu23yEW/aKkwozHoOuROvHS/GK4ngARJGdO7FB7HZuI=
|
||||
@@ -20,4 +20,5 @@ h1:X7LbOLpbDhciJ1O92KiWgnrVP60dDAyBKJqQKJnom+M=
|
||||
20250929034321.sql h1:101FJ8VH12mrZWlt/X1gvKUGOhoiF8tFbjiapAjnHzg=
|
||||
20250929034428.sql h1:i+pROD9p+g5dOmmZma6WF/0Hw5g3Ha28NN85iTo1K34=
|
||||
20250930025550.sql h1:+F+CsCUXD/ql0tHGEow70GhPBX1ZybVn+bh/T4YMh7Y=
|
||||
20250930140351.sql h1:aqXw0j09+xjFqemWlo0enw3tn/IT1FMxw3oUPljkjks=
|
||||
20250930140351.sql h1:9AAEG1AnOAH+o0+oHL5G7I8vqlWOhwRlCGyyCpT/y1Q=
|
||||
20251002085604.sql h1:ml+jTtNkj5T12/loEW77jMScHbt+XAx4mN80heqo7+Q=
|
||||
|
||||
@@ -5,8 +5,10 @@ import (
|
||||
)
|
||||
|
||||
type Division struct {
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
ecore.SmallMain // adjust this according to the needs
|
||||
Code string `json:"code" gorm:"unique;size:10"`
|
||||
Name string `json:"name" gorm:"size:50"`
|
||||
Parent_Id *int16 `json:"parent_id"`
|
||||
Parent *Division `gorm:"foreignKey:Parent_Id;references:Id"`
|
||||
Childrens []Division `gorm:"foreignKey:Parent_Id"` // may need references to self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user