New Topic: <dropUniqueConstraint/> without specifying name

View: New views
1 Messages — Rating Filter:   Alert me  

New Topic: <dropUniqueConstraint/> without specifying name

by LiquiBase Community Forum :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A new topic, '<dropUniqueConstraint/> without specifying name', has been made on a board you are watching.

You can see it at
http://liquibase.org/forum/index.php?topic=188.new#new

The text of the topic is shown below:

Hello,

I created a unique field using liquibase like this:
Code:
<column name="EMAILADDRESS" type="java.sql.Types.VARCHAR(100)">
    <constraints nullable="false" unique="true"/>
</column>


Now I would like to name the unique constraint. I naively tried this approach:
Code:
<changeSet id="18" author="dbn">
    <dropUniqueConstraint tableName="USER" uniqueColumns="EMAILADDRESS"/>
    <addUniqueConstraint tableName="USER" columnNames="EMAILADDRESS" constraintName="UQ_EMAILADDRESS"/>
</changeSet>


But I got following exception:
Code:
Caused by: liquibase.exception.ValidationFailedException: Validation Failed:
     1 changes have validation failures
          liquibase.exception.InvalidChangeDefinitionException: dropUniqueConstraint in 'liquibase/1.0/dbn-8-10-2009.xml::18::dbn' is invalid: constraintName is required


I would really like to know how to add a name to existing constraint or drop a constraint without a name (well with a generated one). Did I "shoot myself in the leg" by not naming the constraints in the first place?
I am running the script against multiple databases and constraint gets called differently so it's not practical for me to use <sql/> tag.

Thanks for any tip or hints.

Dalibor

Unsubscribe to new topics from this board by clicking here: http://liquibase.org/forum/index.php?action=notifyboard;board=1.0

Regards,
The LiquiBase Community Forum Team.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Liquibase-user mailing list
Liquibase-user@...
https://lists.sourceforge.net/lists/listinfo/liquibase-user