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

Add support to get last run migration and also automatic rollback #117

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

oxyno-zeta
Copy link

That will resolve issue #76 .

Other commit will fix the example usage and also some test stability.

@oxyno-zeta
Copy link
Author

Sorry for the duplicated PR (see #77 ). When you "merged" it, I just saw that a bot have removed all my commits :( . Those are separated now.

@dgunay
Copy link

dgunay commented Mar 29, 2022

@andreynering I'd appreciate it if this could be merged soon, I'm waiting on this functionality for a project. Thank you.

}

func (g *Gormigrate) GetLastRunMigration() (*Migration, error) {
return g.getLastRunMigration()
Copy link

Choose a reason for hiding this comment

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

This causes a nil pointer dereference because it eventually calls migrationRan, which needs there to be an active transaction ongoing, but begin() is never called so g.tx is nil.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch ! Should be ok now no ?

Copy link

Choose a reason for hiding this comment

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

Yep, thanks!

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.

None yet

2 participants