--- # https://taskfile.dev version: "3" vars: MIGRATIONS: "internal/database/migrations" includes: compose: dir: "{{.CONTEXT}}" taskfile: local-deployments.yml internal: true tasks: generate: run: once cmds: - task: compose:up:generate - migrate -path {{.MIGRATIONS}} -database {{.DB_URI_GENERATE}} up - sqlc generate --file sqlc.yml lint: cmds: - task: compose:up:generate - sqlc vet --file sqlc.yml - | exit 0 for file in internal/database/migrations/*.sql; do if [[ -f "$file" ]]; then sqlcheck -c -f $file -r 3 # move to 1 fi done mig:create: cmds: - | read -p "Migration Name: " name test -z "$name" && echo "Error: Name is required." && exit 1 migrate create -ext sql -dir {{.MIGRATIONS}} $name