SQL migration tool.
This is tool is adapted for seamless deployments of backend code. Each migration has two steps: half and total.
Half migration is backward-compatible database migration, which allows to work previous and next version of your backend code simultaneously. In this migration you cannot remove or rename columns because in that case the old backend code will break.
Total migration is backward-not-compatible database migration.
The compiled binaries exist under the releases tab: https://github.com/reo7sp/two-step-migrate/releases
Use reo7sp/two-step-migrate docker image.
go get github.com/reo7sp/two-step-migrate
two-step-migrate [command]
Available commands:
new
— Create a new migrationup
— Apply migrationdown
— Rollback migration
Required environment variables:
DATABASE_URL
— DSN to the sql database.
Currently supports only PostgreSQL.