0

I am using Liquibase with SQL Server 2014 for my Spring Boot project. I am trying to populate a few tables at startup and update basic information in there.

Everything works properly all the time, but the moment I change the Spring Boot profile, liquibase fails, complaining the table exists. I tried completely deleting the DB, and expect Liquibase to create it for me. It still complains that the table exists. I dont understand why. If I do the same thing with one Spring Boot profile, it works seamlessly, but the issue is when I change the Spring Boot profile Can you please help?

codeworks
  • 149
  • 1
  • 15
  • Are you doing something like this?https://stackoverflow.com/questions/40088915/using-spring-boot-profiles-with-liquibase-changeset-context-attribute-to-manage – SteveDonie Oct 24 '19 at 16:08
  • No @SteveDonie, we have 3 profiles(Spring Boot) and I just integrated Liquibase with our project. Everything worked, and still works if I work with profile1. Liquibase complains as soon as I change the spring boot profile, even if I remove the entire DB. Is there a possibility there is a cache or something? that i can clear out to come out of this problem? – codeworks Oct 24 '19 at 16:14
  • After this issue, I added tags to see if table does not exist and hoped it would work, but now it complains( after skipping table creation ) as follows - 'Caused by: liquibase.exception.DatabaseException: There is already an object named 'FKnsapu74yxr9i455yts8457nj4' in the database. [Failed SQL: ALTER TABLE name...' – codeworks Oct 24 '19 at 16:19
  • What is the difference between profile 1 and the other profiles? – SteveDonie Oct 24 '19 at 21:16
  • 1
    It was my fault, the difference between the profiles was the DB they were pointing to, and i as expecting the change to happen on the wrong DB.. the other DB was already populated and was being used. That was the cause of the problem. – codeworks Oct 25 '19 at 02:09

0 Answers0