title: "Constraint already exists" when using H2 with liquibase
body: <p>I'm using H2 as a test db, and Liquibase to initialize it. After the first few changelogs, I've got an error.</p>
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelogs/changelog-create-professional-5.xml::5::admin:
       Reason: liquibase.exception.DatabaseException: Constraint &quot;FK_USER&quot; already exists; SQL statement:
  ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id) [90045-200] [Failed SQL: (90045) ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id)]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.18.jar:5.3.18]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.18.jar:5.3.18]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.18.jar:5.3.18]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.6.jar:2.6.6]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.6.jar:2.6.6]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.6.jar:2.6.6]
      at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:136) ~[spring-boot-test-2.6.6.jar:2.6.6]
      at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) ~[spring-test-5.3.18.jar:5.3.18]
      at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-5.3.18.jar:5.3.18]
      at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124) ~[spring-test-5.3.18.jar:5.3.18]
      at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.outputConditionEvaluationReport(SpringBootDependencyInjectionTestExecutionListener.java:53) ~[spring-boot-test-autoconfigure-2.6.6.jar:2.6.6]
      at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:46) ~[spring-boot-test-autoconfigure-2.6.6.jar:2.6.6]
      at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:248) ~[spring-test-5.3.18.jar:5.3.18]
      at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138) ~[spring-test-5.3.18.jar:5.3.18]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$8(ClassBasedTestDescriptor.java:363) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:368) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$9(ClassBasedTestDescriptor.java:363) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
      at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[na:na]
      at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
      at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) ~[na:na]
      at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) ~[na:na]
      at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) ~[na:na]
      at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[na:na]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:362) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:283) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:282) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:272) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at java.base/java.util.Optional.orElseGet(Optional.java:369) ~[na:na]
      at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:271) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:102) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:101) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:66) ~[junit-jupiter-engine-5.8.2.jar:5.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
      at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
      at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) ~[junit-platform-engine-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53) ~[junit-platform-launcher-1.8.2.jar:1.8.2]
      at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) ~[junit5-rt.jar:na]
      at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38) ~[junit-rt.jar:na]
      at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11) ~[idea_rt.jar:na]
      at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35) ~[junit-rt.jar:na]
      at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235) ~[junit-rt.jar:na]
      at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) ~[junit-rt.jar:na]
  Caused by: liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelogs/changelog-create-professional-5.xml::5::admin:
       Reason: liquibase.exception.DatabaseException: Constraint &quot;FK_USER&quot; already exists; SQL statement:
  ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id) [90045-200] [Failed SQL: (90045) ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id)]
      at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:124) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Liquibase.lambda$null$0(Liquibase.java:265) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.lambda$child$0(Scope.java:177) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:186) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:176) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:155) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:239) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Liquibase.lambda$update$1(Liquibase.java:264) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.lambda$child$0(Scope.java:177) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:186) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:176) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:155) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Liquibase.runInScope(Liquibase.java:2404) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Liquibase.update(Liquibase.java:211) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Liquibase.update(Liquibase.java:197) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:314) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:269) ~[liquibase-core-4.5.0.jar:na]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.18.jar:5.3.18]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.18.jar:5.3.18]
      ... 88 common frames omitted
  Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelogs/changelog-create-professional-5.xml::5::admin:
       Reason: liquibase.exception.DatabaseException: Constraint &quot;FK_USER&quot; already exists; SQL statement:
  ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id) [90045-200] [Failed SQL: (90045) ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id)]
      at liquibase.changelog.ChangeSet.execute(ChangeSet.java:695) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:49) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.changelog.ChangeLogIterator$2.lambda$null$0(ChangeLogIterator.java:111) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.lambda$child$0(Scope.java:177) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:186) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:176) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:155) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.changelog.ChangeLogIterator$2.lambda$run$1(ChangeLogIterator.java:110) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.lambda$child$0(Scope.java:177) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:186) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:176) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:155) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:239) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:94) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.lambda$child$0(Scope.java:177) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:186) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:176) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:155) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:239) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.Scope.child(Scope.java:243) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:66) ~[liquibase-core-4.5.0.jar:na]
      ... 106 common frames omitted
  Caused by: liquibase.exception.DatabaseException: Constraint &quot;FK_USER&quot; already exists; SQL statement:
  ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id) [90045-200] [Failed SQL: (90045) ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id)]
      at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:393) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:82) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:150) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1279) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1261) ~[liquibase-core-4.5.0.jar:na]
      at liquibase.changelog.ChangeSet.execute(ChangeSet.java:660) ~[liquibase-core-4.5.0.jar:na]
      ... 126 common frames omitted
  Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Constraint &quot;FK_USER&quot; already exists; SQL statement:
  ALTER TABLE PUBLIC.professional ADD CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES PUBLIC.user (id) [90045-200]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:576) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.message.DbException.get(DbException.java:205) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.message.DbException.get(DbException.java:181) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.ddl.AlterTableAddConstraint.tryUpdate(AlterTableAddConstraint.java:114) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.ddl.AlterTableAddConstraint.update(AlterTableAddConstraint.java:78) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.CommandContainer.update(CommandContainer.java:198) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.command.Command.executeUpdate(Command.java:251) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:228) ~[h2-1.4.200.jar:1.4.200]
      at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:201) ~[h2-1.4.200.jar:1.4.200]
      at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:389) ~[liquibase-core-4.5.0.jar:na]
      ... 131 common frames omitted
  </code></pre>
  <p>This is the changeset that seems to be problematic:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;databaseChangeLog
          xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
          xmlns:ext=&quot;http://www.liquibase.org/xml/ns/dbchangelog-ext&quot;
          xmlns=&quot;http://www.liquibase.org/xml/ns/dbchangelog&quot;
          xsi:schemaLocation=&quot;http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
      http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd&quot;&gt;
      &lt;changeSet author=&quot;admin&quot; id=&quot;5&quot;&gt;
          &lt;createTable tableName=&quot;professional&quot;&gt;
              &lt;column autoIncrement=&quot;true&quot; name=&quot;id&quot; type=&quot;BIGINT&quot;&gt;
                  &lt;constraints primaryKey=&quot;true&quot;/&gt;
              &lt;/column&gt;
              &lt;column name=&quot;clinic_id&quot; type=&quot;BIGINT&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;user_id&quot; type=&quot;BIGINT&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;title&quot; type=&quot;VARCHAR(5)&quot;/&gt;
              &lt;column name=&quot;last_name&quot; type=&quot;VARCHAR(50)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;first_name&quot; type=&quot;VARCHAR(50)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;birth_date&quot; type=&quot;DATE&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;email&quot; type=&quot;VARCHAR(254)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
          &lt;/createTable&gt;
          &lt;addForeignKeyConstraint constraintName=&quot;fk_user&quot;
              baseTableName=&quot;professional&quot; baseColumnNames=&quot;user_id&quot;
              referencedTableName=&quot;user&quot; referencedColumnNames=&quot;id&quot; /&gt;
          &lt;addForeignKeyConstraint constraintName=&quot;fk_clinic&quot;
              baseTableName=&quot;professional&quot; baseColumnNames=&quot;clinic_id&quot;
              referencedTableName=&quot;clinic&quot; referencedColumnNames=&quot;id&quot; /&gt;
          &lt;rollback&gt;
              &lt;dropTable tableName=&quot;professional&quot;/&gt;
          &lt;/rollback&gt;
      &lt;/changeSet&gt;
  &lt;/databaseChangeLog&gt;
  </code></pre>
  <p>Strange thing is, there are changesets, that have foreign key constraints in them, and they are initialized successfuly. For example:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;databaseChangeLog
          xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
          xmlns:ext=&quot;http://www.liquibase.org/xml/ns/dbchangelog-ext&quot;
          xmlns=&quot;http://www.liquibase.org/xml/ns/dbchangelog&quot;
          xsi:schemaLocation=&quot;http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
      http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd&quot;&gt;
      &lt;changeSet author=&quot;admin&quot; id=&quot;4&quot;&gt;
          &lt;createTable tableName=&quot;patient&quot;&gt;
              &lt;column autoIncrement=&quot;true&quot; name=&quot;id&quot; type=&quot;BIGINT&quot;&gt;
                  &lt;constraints primaryKey=&quot;true&quot;/&gt;
              &lt;/column&gt;
              &lt;column name=&quot;clinic_id&quot; type=&quot;BIGINT&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;user_id&quot; type=&quot;BIGINT&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot;/&gt;
              &lt;/column&gt;
              &lt;column name=&quot;patient_id&quot; type=&quot;VARCHAR(30)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;insurance_number&quot; type=&quot;VARCHAR(30)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;title&quot; type=&quot;VARCHAR(5)&quot;/&gt;
              &lt;column name=&quot;last_name&quot; type=&quot;VARCHAR(50)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;first_name&quot; type=&quot;VARCHAR(50)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;birth_date&quot; type=&quot;DATE&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;sex&quot; type=&quot;VARCHAR(5)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;phone_number&quot; type=&quot;VARCHAR(10)&quot;&gt;
                  &lt;constraints nullable=&quot;false&quot; /&gt;
              &lt;/column&gt;
              &lt;column name=&quot;email&quot; type=&quot;VARCHAR(254)&quot;/&gt;
              &lt;column name=&quot;comment&quot; type=&quot;VARCHAR(255)&quot;/&gt;
          &lt;/createTable&gt;
          &lt;addForeignKeyConstraint constraintName=&quot;fk_user&quot;
              baseTableName=&quot;patient&quot; baseColumnNames=&quot;user_id&quot;
              referencedTableName=&quot;user&quot; referencedColumnNames=&quot;id&quot; /&gt;
          &lt;addForeignKeyConstraint constraintName=&quot;fk_clinic&quot;
              baseTableName=&quot;patient&quot; baseColumnNames=&quot;clinic_id&quot;
              referencedTableName=&quot;clinic&quot; referencedColumnNames=&quot;id&quot; /&gt;
          &lt;rollback&gt;
              &lt;dropTable tableName=&quot;patient&quot;/&gt;
          &lt;/rollback&gt;
      &lt;/changeSet&gt;
  &lt;/databaseChangeLog&gt;
  </code></pre>
  <p>Everything works in prod db (PostgreSQL). What am I doing wrong?</p>