cmd/entc: add generate.go file to env init (#402)

* cmd/entc: add generate.go file to env init

* doc: update getting-started and codegen documentation
This commit is contained in:
Ariel Mashraki
2020-03-24 19:23:30 +02:00
committed by GitHub
parent abee904420
commit a2ea5bfbee
8 changed files with 127 additions and 42 deletions

View File

@@ -27,10 +27,12 @@ is to have an `ent` directory under the root directory of the project.
## Generate Assets
After adding a few [fields](schema-fields.md) and [edges](schema-edges.md), you want to generate
the assets for working with your entities. Run the following command:
the assets for working with your entities. Run `entc generate` from the root directory of the project,
or use `go generate`:
```bash
entc generate ./ent/schema
go generate ./ent
```
The `generate` command generates the following assets for the schemas: