liquibase.exception.DatabaseException: Index (idx_mil_country_type_id) already exists in database. [Failed SQL: CREATE INDEX jxclean351:ngp.idx_mil_country_type_id ON jxclean351:ngp.military_service(country_type_id)]

JIRA | Lyle H. Gray | 3 months ago
  1. 0

    When using the <indexExists> precondition in Informix to check to see if an index exists, the check does not appear to succeed if an index actually exists. Applying the following pair of changesets to "jxclean" {code} <changeSet id="ngp-constituent-jpa.military_service.NewTableCreation" author="lgray"} <createTable tableName="military_service"> <column name="id" type="bigint"> <constraints nullable="false"/> </column> <column name="country_type_id" type="bigint"> <constraints nullable="false"/> </column> </createTable> <addPrimaryKey tableName="military_service" columnNames="id" constraintName="pk_military_service"/> <createIndex tableName="military_service" indexName="idx_mil_country_type_id"> <column name="country_type_id"/> </createIndex> </changeSet> <changeSet id="ngp-constituent-jpa.military_service.createIndex" author="lgray"> <preConditions onFail="MARK_RAN"> <tableExists tableName="military_service"/> <not> <indexExists indexName="idx_mil_country_type_id"/> </not> </preConditions> <createIndex tableName="military_service" indexName="idx_mil_country_type_id"> <column name="country_type_id"/> </createIndex> </changeSet> {code} generates the following error when Liquibase attempts to execute the second changeset: {code} SEVERE 9/21/16 1:43 PM: liquibase: com.jenzabar.ngp:ngp-test-jpa::ngp-constituent-jpa.military_service.createIndex::sowmya: Index (idx_mil_country_type_id) already exists in database. [Failed SQL: CREATE INDEX jxclean351:ngp.idx_mil_country_type_id ON jxclean351:ngp.military_service(country_type_id)] liquibase.exception.MigrationFailedException: Migration failed for change set com.jenzabar.ngp:ngp-test-jpa::ngp-constituent-jpa.military_service.createIndex::sowmya: Reason: liquibase.exception.DatabaseException: Index (idx_mil_country_type_id) already exists in database. [Failed SQL: CREATE INDEX jxclean351:ngp.idx_mil_country_type_id ON jxclean351:ngp.military_service(country_type_id)] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:605) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79) at liquibase.Liquibase.update(Liquibase.java:214) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.integration.commandline.Main.doMigration(Main.java:1126) at liquibase.integration.commandline.Main.run(Main.java:184) at liquibase.integration.commandline.Main.main(Main.java:103) Caused by: liquibase.exception.DatabaseException: Index (idx_mil_country_type_id) already exists in database. [Failed SQL: CREATE INDEX jxclean351:ngp.idx_mil_country_type_id ON jxclean351:ngp.military_service(country_type_id)] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1273) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1255) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:568) ... 7 more {code} even though the precondition should have prevented the second changeset from attempting to create the index again.

    JIRA | 3 months ago | Lyle H. Gray
    liquibase.exception.DatabaseException: Index (idx_mil_country_type_id) already exists in database. [Failed SQL: CREATE INDEX jxclean351:ngp.idx_mil_country_type_id ON jxclean351:ngp.military_service(country_type_id)]
  2. 0

    Error in using tag in command line when using liquibase

    Stack Overflow | 2 years ago | Ivan Wangsa
    liquibase.exception.DatabaseException: java.lang.NullPointerException
  3. 0

    Liquibase Hibernate Plugin Does Not Work

    Stack Overflow | 2 years ago | Jazzepi
    liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:com.companyname.dirtylibs.persistence.entities?dialect=org.hibernate.dialec t.MySQL5Dialect)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Extension fails to load hibernate driver and breaks if I manually specify it

    GitHub | 2 years ago | Jazzepi
    liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: Driver class was not specified and could not be determined from the url (hibernate:spring:com.companyname.dirtylibs.persistence.entities?dialect=org.hibernate.dialec t.MySQL5Dialect)
  6. 0

    Using Liquibase on Teradata 14. - Liquibase Forums

    liquibase.org | 1 year ago
    liquibase.exception.DatabaseException: com.teradata.jdbc.jdbc_4.util.JDBCEx ception: [Teradata Database] [TeraJDBC 14.00.00.41] [Error 3802] [SQLState 42S02 ] Database 'information_schema' does not exist.

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. liquibase.exception.DatabaseException

      Index (idx_mil_country_type_id) already exists in database. [Failed SQL: CREATE INDEX jxclean351:ngp.idx_mil_country_type_id ON jxclean351:ngp.military_service(country_type_id)]

      at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement()
    2. Liquibase Core
      Main.main
      1. liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301)
      2. liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
      3. liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107)
      4. liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1273)
      5. liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1255)
      6. liquibase.changelog.ChangeSet.execute(ChangeSet.java:568)
      7. liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
      8. liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
      9. liquibase.Liquibase.update(Liquibase.java:214)
      10. liquibase.Liquibase.update(Liquibase.java:192)
      11. liquibase.integration.commandline.Main.doMigration(Main.java:1126)
      12. liquibase.integration.commandline.Main.run(Main.java:184)
      13. liquibase.integration.commandline.Main.main(Main.java:103)
      13 frames