rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.23k stars 280 forks source link

How do you apply your migrations #125

Closed alok87 closed 5 years ago

alok87 commented 5 years ago

We run our service in kubernetes. What is the right way to execute migrations using sql-migrate as part of deployment to kubernetes.

We need to have sql-migrate binary in our Dockerfile or entrypoint?

rubenv commented 5 years ago

Embed migrations in the binary (e.g. using packr) and use it as a library.

Or use an init container.

alok87 commented 5 years ago

We don't use packer. Then do I need to make the binary be part of Docker image and then execute the binary in the entrypoint to apply migrations? Then i need to copy migration files also in Dockerfile also

rubenv commented 5 years ago

Note the missing e: packr, not packer.

Check the README in this repo for instructions on how to use it as a library.

On Mon, 26 Nov 2018, 12:50 Alok Kumar Singh <notifications@github.com wrote:

We don't use packer. Then do I need to make the binary be part of Docker image and then execute the binary in the entrypoint to apply migrations? Then i need to copy migration files also in Dockerfile also

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rubenv/sql-migrate/issues/125#issuecomment-441612769, or mute the thread https://github.com/notifications/unsubscribe-auth/AACnmKzDnGTOtL3CglWaTkLEomCUqyT4ks5uy9WQgaJpZM4Yy1V_ .

alok87 commented 5 years ago

Thanks let me try out.