Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
NULL not allowed for column "installed_by" with H2 in Oracle mode #1794
What version of Flyway are you using?
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
What database are you using (type & version)?
H2 1.4.196; MODE=Oracle
What operating system are you using?
Windows 10 Pro 64-bit
What did you do?
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
final Flyway flyway = new Flyway(); flyway.setDataSource("jdbc:h2:mem:test;MODE=Oracle;DB_CLOSE_DELAY=-1", "", ""); flyway.migrate();
This is about the most basic, fundamental thing I can do with Flyway using H2 in Oracle mode. And I want to use Oracle mode, because Oracle is used as the production database (which one day hopefully will also use Flyway).
What did you expect to see?
I expected it to initialize the metadata table.
What did you see instead?
If I remove the
I don't know if the root problem is Flyway or H2's Oracle mode, but I suspect it is a Flyway problem, trying to do something that Oracle doesn't allow. (Guessing even more, maybe Flyway made assumptions when creating the metadata table schema, and should have been more explicit if it wanted
I found a workaround! I can set the "installed-by" value:
I'm glad I found a workaround. But this bug should still be fixed; if the default value for "installed-by" is
This issue may have been closely a little prematurely. It was recognized that H2 "somehow" returns
Here H2 allows an in-memory database to be created with
So would Oracle return
Where is it documented that
This may be one of those cases that is a hard call, with no neat-and-tidy answer. However, based upon the details, I'm leaning towards thinking that the appropriate fix would be for Flyway not to assume that
I'm a bit late to the party, but I encountered the same issue and want to help others who might suffer from this problem. I managed to work around it by providing the
After this, the user was correctly set to sa in the schema_version table.