Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

LB 3.0.2 against DB2 : Error with dropAllDatabaseObjects

$
0
0
Hi all,
we have tested LB 3.0.2 (using Ant 1.8.2) with our scripts (in order to upgrade from LB 2.0.1) against DB2 v9.7.0.5 and found an error:

    <dropAllDatabaseObjects
        driver="@{attribute.targetdb.driver}"
        classpathref="classpath"
        url="@{attribute.targetdb.url}"
        username="@{attribute.targetdb.user}"
        password="@{attribute.targetdb.pwd}"
        defaultSchemaName="@{attribute.targetdb.schema}"
        schemas="@{attribute.targetdb.schema}"
        promptOnNonLocalDatabase="${liquibase.prompt.non.local.db}"
    />

[dropAllDatabaseObjects] INFO 01.08.13 16:10:liquibase: Successfully acquired change log lock
[dropAllDatabaseObjects] INFO 01.08.13 16:10:liquibase: Dropping Database Objects in schema: LB_TEST
[dropAllDatabaseObjects] INFO 01.08.13 16:11:liquibase: Successfully released change log lock

BUILD FAILED
C:\Development\eclipse-workspaces\db\buildLiquiBase_Config1.xml:216: The following error occurred while executing this line:
C:\Development\eclipse-workspaces\db\buildLiquiBase_Worker.xml:575: liquibase.exception.DatabaseException: Error executing SQL ALTER TABLE "ANOTHER_SCHEMA"."TableX" DROP CONSTRAINT "FK_TableX_CONTAIN": DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=FK_TableX_CONTAIN, DRIVER=4.7.85

Ant macro attribute: @{attribute.targetdb.schema} = LB_TEST

"SQLCODE=-204, SQLSTATE=42704, SQLERRMC=FK_TableX_CONTAIN" means that DB2 cannot find a (foreign key) constraint for table TableX in DB2 schema ANOTHER_SCHEMA.

It seems that LB 3.0.2 finds that table TableX in a second DB2 schema ANOTHER_SCHEMA (=! Ant macro attribute @{attribute.targetdb.schema} = LB_TEST), and tries to drop a FK constraint with the same name like that one at table LB_TEST.TableX. But that second table does not have such a FK. If we drop the FK in ANOTHER_SCHEMA manually then dropAllDatabaseObjects does its work, and drops the rest of the DB objects in schema LB_TEST.

Maybe there is a relation with another bug against DB2 when it comes to running preConditions not tableExists statements (another thread of mine).

This Ant script works fine with LB LB 2.0.1.

Kind regards,
Frank

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>