Skip to content

adds a 'status' command that checks for pending migrations.#30

Open
blunckr wants to merge 1 commit into
robinjoseph08:masterfrom
blunckr:add-status-command
Open

adds a 'status' command that checks for pending migrations.#30
blunckr wants to merge 1 commit into
robinjoseph08:masterfrom
blunckr:add-status-command

Conversation

@blunckr

@blunckr blunckr commented Aug 28, 2021

Copy link
Copy Markdown

This adds a new command called 'status', that you run like this: go run example/*.go status. If there are no pending migrations, it will print a message indicating that migrations are up to date, and return nil. If there are pending migrations, it will return an error with the message indicating how many are pending. If things are set up as described in the example dir, this will also cause the program to exit with status 1.

This is useful in deployment, for example, in kubernetes, new pods can use this as a check to determine if they are ready to start receiving traffic.

@blunckr

blunckr commented Aug 28, 2021

Copy link
Copy Markdown
Author

Oh, I just saw that someone else has already opened a pr that also adds a status command. though it seems like it's intended for a different purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant