What's new
make:relations command
- Added
grove make:relationsto infer GORM relationships from foreign keys. - By default, it generates only the has-many side on target models.
- Added
--with-belongs-toto also generate belongs-to fields on source models.
New make:relations flags
--model: process only specific source model(s) (repeatable or comma-separated).--verbose: print detailed relation inference logs.--dry-run: preview changes without writing files.--path: select custom models directory.
Improvements
- FK inference now validates supported field types (e.g.
string, ints,uuid.UUID). - Better pluralization for relation collection fields in PascalCase names.
- Prevents duplicate relation fields.
Documentation
- Updated
README.mdwithmake:relationsusage, flags and examples. - Updated docs site data in
docs/src/data/docs.jswith a dedicated command section.
Install / upgrade:
go install github.com/caiolandgraf/grove@latest