0

I am currently using native SQL queries to create sequences and get sequence values in a Grails 4 web app. This normally doesn't cause much of an issue, but when I use the grails database migration plugin to update my database (using liquibase), it keeps wanting to delete the sequences in the database.

The workaround is to manually delete the liquibase statements that affect the sequences, but I am not comfortable with the potential for human error here. The most obvious way to fix this would be to declare that these sequences exist so that Grails/Liquibase doesn't want to delete them. How do I go about doing this?

Anonymous1
  • 3,877
  • 3
  • 28
  • 42
  • What is it in your project that lets liquibase know that the sequence even exists? – Jeff Scott Brown Sep 16 '21 at 13:02
  • I'm using the Grails Database Migration plugin: https://github.com/grails-plugins/grails-database-migration. It does not see the sequences in my project since I handle them manually, but it sees them in the database. The plugin, using liquibase, wants to sync the database structure and adds statements to delete the existing sequences. – Anonymous1 Sep 17 '21 at 15:31
  • "The plugin, using liquibase, wants to sync the database structure and adds statements to delete the existing sequences." - that is a little surprising and is not how the thing is designed to behave if I am understanding you. Are you saying that liquibase deletes everything in the database? Just sequences? – Jeff Scott Brown Sep 17 '21 at 17:02

0 Answers0