-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error when running Liquibase: Table already exists #1
Comments
Hello, Have a look at similar variable in your cache database so that 'DATABASECHANGELOGLOCK' is treated in the same way regardless of the case. Thanks, |
Hi @phxql . Are you still using this Liquibase Cache database extension? |
I never used this extension but experienced the same issue using liquibase for H2 database with I got around my problem by monkey-patching super.unquotedObjectsAreUppercased=true; Before I did that I researched sources of liquibase. I found out that when it checks if DATABASECHANGELOGLOCK table exists it does it in a different way than checking DATABASECHANGELOG for existence. I don't remember exactly what the difference was but probably it checks for uppercased name of the table adding quotes nonetheless which leads to a negative result and subsequent attempt to create DATABASECHANGELOGLOCK again. How I did monkey-patching: I created a package |
I don't use it anymore. |
@kurbatov Thanks for the feedback. Are you still using H2 with Liquibase and are you still experiencing the issue? |
Thanks @phxql for the feedback. |
Yes, I do, in that project with monkey-patched |
It looks like the issue won't reproduce for H2 with |
I am still seeing the issue. Tried it with 3.10.1 and 4.0.0. I am running multiple spring.boot tests. The error i am seeing is: |
Hi, i can workaround the issue by changing the code a bit following @kurbatov suggestion. I implemented this for version liquibase version 4.0.0 and posted what i did over on stackoverflow (https://stackoverflow.com/questions/63036299/spring-boot-testing-with-liquibase-fails/63173456#63173456). I do think that this is something which should be addressed in liquibase. Based on my understanding we should never fail if the "DATABASECHANGELOG" table creation fails because it already exists (there are legitimate reason to fail if the creation fails in general, but not due to it already existing). Anyway, if my reasoning is sound, is there any way to work that into the official code? |
Hey, @molivasdat ! Do you need any help with this? |
Hi @r2liquibase. Sure I'll take the help if you have a fix for this. |
Sounds like we need to override the method that deals with databasechangelog table creation. If this is realated to H2, can we get help from internal engineering? |
Hello,
i'm getting an error when running Liquibase against a Cache database:
When the database is empty, the first update works:
But every subsequent update call fails:
┆Issue is synchronized with this Jira Bug by Unito
The text was updated successfully, but these errors were encountered: