Support for check constraints planned?

Hi,

we are currently evaluating LiquiBase but unfortunately I cannot find anything in the manual for defining check constraints on a column.

Is this not supported?
Are there any plans to support this in the near future?

Thanks

There is not a built in tag for doing that.  We haven’t looked into cross-database support for check constraints enough, or how differently the syntax varies between them to decide if it is something to include or not. 

For now, you can use the tag to put whatever non-supported and/or database-specific changes in that you need.

Nathan

If you use Oracle, you could try http://liquibase.jira.com/wiki/display/CONTRIB/Oracle+Extensions
It has support for check constraints and other Oracle specific changes.

Thanks for the answers.

The Oracle extension looks nice, but we are also using other DBMS (such as Postgres)

Btw: Why is the deferrable primary key only an Oracle extension? This is supported by other databases as well…

There is some built-in support for deferred keys.  You can specify deferrable=“true|false” on the foreignKey tags.  I think the oracle extension builds on that, though.

Nathan

Originally posted by: damian_g
If you use Oracle, you could try http://liquibase.jira.com/wiki/display/CONTRIB/Oracle+Extensions It has support for check constraints and other Oracle specific changes.
Can I download the jar file somewhere or do I need to build it from the SVN sources?
Originally posted by: user42
Originally posted by: damian_g
If you use Oracle, you could try http://liquibase.jira.com/wiki/display/CONTRIB/Oracle+Extensions It has support for check constraints and other Oracle specific changes.
Can I download the jar file somewhere or do I need to build it from the SVN sources?
Stupid me :) It is attached to that wiki page.

But I am no able to use this extension. On the wiki page it says, that all I need to do is to put the jar file into my classpath.

So my liquibase.properties looks like this:

    driver: oracle.jdbc.OracleDriver classpath: ojdbc6-11.1.0.7.0.jar;liquibase-extensions-1.0.jar

    url: jdbc:oracle:thin:…
    username: SCOTT
    password: tiger

My changeset includes the following:
    But when I run liquibase using the "update" command, I get the following error message:

    Migration Failed: The prefix “ora” for element “ora:addCheck” is not bound.

    What am I missing?

    Did you define the ora namespace for the Oracle extension in your root xml element?

      <?xml version="1.0" encoding="UTF-8"?>

      <databaseChangeLog xmlns=“http://www.liquibase.org/xml/ns/dbchangelog”

      xmlns:xsi="<a href='http://www.w3.org/2001/XMLSchema-instance"' target='_blank'>http://www.w3.org/2001/XMLSchema-instance"</a>
      
      xmlns:ora="<a href='http://www.liquibase.org/xml/ns/dbchangelog-ext"' target='_blank'>http://www.liquibase.org/xml/ns/dbchangelog-ext"</a>
      
      xsi:schemaLocation="<a href='http://www.liquibase.org/xml/ns/dbchangelog' target='_blank'>http://www.liquibase.org/xml/ns/dbchangelog</a>
      

              http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd

              http://www.liquibase.org/xml/ns/dbchangelog-ext P:\workspaces\workspace_liquibase\oracle-extensions\src\java\liquibase\ext\ora\xml\dbchangelog-ext.xsd">

    Regards,
      Frank