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

Use all-caps table names in the liquibase script #340

Conversation

immortaly007
Copy link
Contributor

On case-sensitive databases, the table names in the Liquibase script cause issues, since they're all lower case. This change fixes that.

It also removes the tdss prefix from the table names.

@zemian
Copy link
Contributor

zemian commented Feb 13, 2019

Hi @immortaly007 Thank you for the PR! Would you mind providing some instruction as how to use this file? You can post them here as comment, and I will try to create a WIKI page so other can use it.

@immortaly007
Copy link
Contributor Author

immortaly007 commented Feb 14, 2019

Hi @zemian,

The file is useful for users that want to control their database schema using Liquibase, as opposed to using the "quartz standard" way of generating/controlling the database schema. The advantage of using Liquibase is that this might integrate better with the existing schema generation, and it keeps the application and quartz schema generation in one place.

The easiest way the file can be used is to copy it next to the users' existing changelog file (for example to /src/main/resources/db/changelog/), and then reference it in the users' existing changelog using the following line of XML:

<include file="liquibase.quartz.init.xml" relativeToChangelogFile="true" />

This way, Liquibase will ensure that the quartz tables are created (with their default names).

Note: one could probably also reference the file directly on the quartz classpath, but I'm not sure what that path would be, and copying the file allows the user to modify it if needed.

When using the spring-boot-starter-quartz, I'd recommend setting the following application property to prevent quartz from also generating/overriding the schema:

spring.quartz.jdbc.initialize-schema=never

@zemian
Copy link
Contributor

zemian commented Feb 14, 2019

Thank you @immortaly007 for the info! Few updates I have for this PR:

  1. Because we have to add these into 2.3.x, I have created a new PR Use all-caps table names in the liquibase script #340 #355 with your commits in it. So I will close this as dup.
  2. I have learned few things about Liquibase and tested with Postgres. I found there is a need to modify the config. I also improved it with table_prefix.
  3. I now have created a WIKI page describing how to use this tool: https://github.com/quartz-scheduler/quartz/wiki/How-To-Setup-Databases-for-Quartz#using-liquibase-tool

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