How to Use Database Migrations in Production (golang-migrate, goose, atlas)

Execute database migrations in production using golang-migrate with the up command and a secure connection string.

Run migrations in production by executing your migration tool against the live database within a transaction to ensure atomicity. Use golang-migrate with the -path flag pointing to your SQL directory and the -database flag pointing to your production connection string.

migrate -path /app/migrations -database "postgres://user:pass@host:5432/dbname?sslmode=require" up