Problem with migrations using h2 db

69 views
Skip to first unread message

Daniel Fitzpatrick

unread,
Apr 15, 2020, 3:28:30 PM4/15/20
to Luminus
If I run (migrate) and an *up file has a syntax error, any further attempt to apply migrations up/down results in this log msg:

"Migration reserved by another instance. Ignoring"

At that point it seems the only way forward is to delete the database, fix the syntax error, and start over.  Is there a better way?

Juraj Martinka

unread,
Apr 16, 2020, 2:29:36 PM4/16/20
to Luminus
I'm not sure if there's a proper way to deal with this situation but what I do when a migration fails and the DB ends up in an incorrect state is 
that I check the schema_migrations table and there's (almost always in such cases) the first row with id -1; just delete it and try again.

Daniel Fitzpatrick

unread,
Apr 16, 2020, 3:39:27 PM4/16/20
to Luminus
I'll admit to having troubles connecting to h2 using the bundled tools.  :-\
Reply all
Reply to author
Forward
0 new messages