-
Notifications
You must be signed in to change notification settings - Fork 0
Liquibase and JOOQ
- IMPORTANT: Please note that these are the steps I take to make everything consistently work even though it should not all be required. Once the related issues are resolved we need to update this wiki page.
- IMPORTANT: At this time all JOOQ generated code is suppose to be committed into the repository.
-
TIP: If you run
liquibase:updatethen I recommend runningliquibase:dropAlljust before starting your web server otherwise it can sometimes cause errors.
- IMPORTANT: The server should be SHUTDOWN while you perform these steps.
liquibase:update
If you are just doing a simple update with the latest changelogs then you can run liquibase:update in Maven and your database should be updated.
-
liquibase:releaseLocks(if your DB is locked. This happens if the JVM is shutdown during an update) liquibase:dropAllliquibase:clearCheckSumsliquibase:update
If you are debugging and need to reset everything then it can get more complicated. In this case you need to run the above three Maven commands in order every time. The first liquibase:dropAll is to delete the contents of the database. Then you need to use liquibase:clearCheckSums so that there are no conflicts with the changeset id number. This step is very important because if you are debugging then you will most likely be using the same changeset id as you debug. And lastly you need to update the database with liquibase:update
-
IMPORTANT: You need to have the database up and running for this to work. Meaning that
liquibase:updatemust have been the last command you ran. -
jooq-codegen:generate(from within the pathmind-database submodule)
Running this will generate the code needed by JOOQ for the database.
-
TIP: You need to have the database up and running for this to work. Meaning that
liquibase:updatemust be run just before you runjooq-codegen:generate. -
TIP: In some cases for whatever reason JOOQ will run but doesn't seem to update anything. It's almost like it's cashing something. In those cases the first thing to try is to
cleanthe project. This works most of the time but if that fails then the next step is to bothcleanthe project and do a full clean of the Liquibase database, that is runliquibase:dropAll,liquibase:clearCheckSums, and thenliquibase:updatealong with a maven projectclean.