Development notes.
Unit- and integration tests are triggered automatically for each commit.
To make tools like gopls
(the Go language server) understand build tags,
set the GOFLAGS
environment variable accordingly, e.g.
export GOFLAGS="-tags=integration,sqlite,mysql,postgres"
The database migration is managed using atlas. See here for an in-depth explanation.
The schema is defined programmatically in generated/ent/schema/
.
Example: Adding a new column to jobs
- Modify
./generated/ent/schema/job.go
. - Generate code, e.g.
go generate ./generated/ent
. - Generate
*.sql
migrations:just postgres-generate-schema added-column
Example: Update atlas.sum
$ docker run --rm -v $(pwd):/git docker.io/arigaio/atlas migrate hash --dir file:///git
This is necessary if you edit the sql files.