-
Notifications
You must be signed in to change notification settings - Fork 100
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
base: master
Are you sure you want to change the base?
Conversation
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. |
@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() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, thanks!
That will resolve issue #76 .
Other commit will fix the example usage and also some test stability.