feat(llm): update
This commit is contained in:
@@ -156,6 +156,8 @@ Models live in:
|
|||||||
4) Map complex field types (JSON/ARRAY/UUID/…) via transform file:
|
4) Map complex field types (JSON/ARRAY/UUID/…) via transform file:
|
||||||
|
|
||||||
- `backend/database/.transform.yaml` → `field_type.<table>`
|
- `backend/database/.transform.yaml` → `field_type.<table>`
|
||||||
|
- MUST: For ALL enum fields (even simple `VARCHAR`), you MUST map them to their corresponding Go enum type (defined in `backend/pkg/consts`) in `.transform.yaml`. This ensures strong typing in the generated models and avoids unsafe manual casting (e.g., `string(consts.GenderMale)`).
|
||||||
|
- MUST: For deterministic JSONB fields (where the structure is known), define a corresponding Go struct in `backend/database/fields/` and map the field to `types.JSONType[fields.StructName]` in `.transform.yaml`.
|
||||||
|
|
||||||
5) Generate models:
|
5) Generate models:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user