Skip to content

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

Open
oxyno-zeta wants to merge 5 commits into
go-gormigrate:masterfrom
oxyno-zeta:issue-76
Open

Add support to get last run migration and also automatic rollback#117
oxyno-zeta wants to merge 5 commits into
go-gormigrate:masterfrom
oxyno-zeta:issue-76

Conversation

@oxyno-zeta
Copy link
Copy Markdown

That will resolve issue #76 .

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

@oxyno-zeta
Copy link
Copy Markdown
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
Copy Markdown

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.

Comment thread gormigrate.go
}

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

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
Copy Markdown
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
Copy Markdown

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.

2 participants