Skip to content
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

Retain the case of database objects (tables, columns, etc.) from the … #2

Merged

Conversation

ajwhitney
Copy link
Contributor

We ran into a problem using your liquibase-slick codegen plugin in our environment. The code generated referenced database object names (for tables, index, columns, etc) that were all upper case. This was fine for MySQL on OSX or Windows but our deployment targets are Linux and on that platform this didn't jive with the actual database names which for us are all lowercase (Linux MySQL is case sensitive by default). This happens because the intermediate H2 database that's used to drive the slick codegen uppercases all database object names by default. There is a connection option, DATABASE_TO_UPPER (default TRUE), that controls whether the case is retained rather than always uppercased in H2. Setting this setting to FALSE retains the case of the objects as specified in the Liquibase changelog which is what we were expecting to happen.

The H2 docs for that connection setting are http://www.h2database.com/javadoc/org/h2/engine/DbSettings.html#DATABASE_TO_UPPER

It's working for us with this change. We'd love for you to incorporate this into your plugin or to abstract out the H2 connection settings so this is easy to set/override in the plugin configuration.

Happy to discuss at your convenience.

…Liquibase changelog rather than always forcing them to uppercase. This is achieved by connecting to the temporary H2 database using connection option DATABASE_TO_UPPER=FALSE. See http://www.h2database.com/javadoc/org/h2/engine/DbSettings.html#DATABASE_TO_UPPER
@daniel-shuy daniel-shuy merged commit dfccc6a into daniel-shuy:master Mar 8, 2018
@daniel-shuy
Copy link
Owner

LGTM, thanks for the PR :)

I'll also consider implementing your suggestion of abstracting out the H2 connection settings when I have more time.

@daniel-shuy daniel-shuy added this to the 0.1.2 milestone Mar 13, 2018
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.

None yet

2 participants