I have a sql script (it is just schema definition). The script is a modified version (getting rid of the bad characters h2 doesn't like) of a mysql dumb.
The script runs and the schema is inserted into the h2 database, but the issue is that all of the database names are in uppercase ('xyz' gets converted to 'XYZ').
I need them to stay in lowercase because my application is looking for the lowercase (and all of the tables in the mysql db are lowercase).
Why is this happening? How can I tell h2 to not do that? Is there a better way to insert schema definition into h2?
This is the INT command I'm running:
jdbc:h2:mem:~/test;INIT=runscript from '~/schema.sql'
EDIT: Just tried this on the h2 console, same thing. So this isn't some INIT issue, it is with the 'RUNSCRIPT' command.
Tried this
RUNSCRIPT FROM '~/schema.sql'
Found the issue. By default, h2 has this setting set to true DATABASE_TO_UPPER
. Setting that to false will save the data as expected. So in my INIT command (before it), I entered:
jdbc:h2:mem:~/test;DATABASE_TO_UPPER=false;INIT=runscript from '~/schema.sql'
Now the tables are being inserted in the correct case
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With