Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing migrations handling. BMP-596 #72

Closed

Conversation

Stepych
Copy link

@Stepych Stepych commented Oct 4, 2017

resolves #73


# Install

$ go get -u github.com/pressly/goose/cmd/goose
$ go get -u github.com/mc2soft/goose/cmd/goose
Copy link
Collaborator

@VojtechVitek VojtechVitek Oct 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't expect us to merge this change github.com/mc2soft/goose, do you? :)

Can you iron this PR out and provide a high-level overview of what is this PR supposed to solve? Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR resolves #73. Ok, i will iron it to avoid "mc2soft" mentions)) But pls give me feedback, do you consider such issue?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in the high-level, this would find all the missing migrations -- ie. all migrations that are available but were not applied in the DB, right?

You can

  1. list them
  2. apply them

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with new commands:

  1. status-missing
  2. up-missing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, do we need 1. at all? Can't goose status show these migrations as well by default?

Imho, 2. is explicit enough. I like it. It might even help people who insist on using Timestamp based migrations #63.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status show all migrations (could be a lot of them!), including missing ("pending"). But the new status-missing shows only missing migrations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like someone from #63 to test this feature. I don't really have the same use case. Can you ping these guys, once you have the PR ready?

Copy link
Collaborator

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not finished. We can't merge references to the github.com/mc2soft/goose fork.

Copy link
Collaborator

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stepych are you planning to finish this PR?

Or should we freeze it / close it? Thanks!

@VojtechVitek
Copy link
Collaborator

VojtechVitek commented Mar 4, 2019

Closing due to inactivity

EDIT:
I've also closed the original issue, since I believe we don't want to apply any missing migrations.

We explicitly prefer to error out if there's any gap in the migrations. If goose skips those migrations right now, it's probably a bug and we should fix that and make it an error.

We don't want to apply any migrations that are out of the sequence number order.

There shouldn't be any "skipped" migration if you version your migrations properly. See https://github.com/pressly/goose#hybrid-versioning for further explanation.

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.

Missing migrations
2 participants