Last active
June 5, 2024 07:04
-
-
Save olned/9f95f293277354f6e321b3717bc4e150 to your computer and use it in GitHub Desktop.
Taskfile golang-migrate docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
tasks: | |
migrate-up: | |
dir: "{{.TASKFILE_DIR}}/" | |
cmds: | |
- docker run -v ./migrations:/migrations --user $(id -u):$(id -g) --network host migrate/migrate -path /migrations -database ${DATABASE_URL} up | |
description: "Apply all up migrations" | |
migrate-down: | |
dir: "{{.TASKFILE_DIR}}/" | |
cmds: | |
- docker run -v ./migrations:/migrations --user $(id -u):$(id -g) --network host migrate/migrate -path /migrations -database ${DATABASE_URL} down | |
description: "Revert the last migration" | |
migrate-create: | |
dir: "{{.TASKFILE_DIR}}/" | |
cmds: | |
- docker run -v ./migrations:/migrations --user $(id -u):$(id -g) --network host migrate/migrate create -ext sql -dir /migrations -seq {{.CLI_ARGS}} | |
description: "Create a new migration file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment