db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Fereira (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DDLUTILS-85) Add support for unique constraints
Date Mon, 25 Sep 2006 17:09:51 GMT
    [ http://issues.apache.org/jira/browse/DDLUTILS-85?page=comments#action_12437610 ] 
            
John Fereira commented on DDLUTILS-85:
--------------------------------------

I couldn't tell what the resolution status was for this issue...

Using a McKoi database I created a database table with a unique key using the following SQL:
CREATE TABLE NOTIFICATION_CONTENT_TYPES
(
ID INTEGER NOT NULL,
NAME VARCHAR(500) NOT NULL,
DESCRIPTION VARCHAR(1000) NOT NULL,
NAMESPACE VARCHAR(1000) NOT NULL
)
;
ALTER TABLE NOTIFICATION_CONTENT_TYPES
ADD CONSTRAINT NOTIFICATION_CONTENT_TYPE_PK PRIMARY KEY
(ID);

ALTER TABLE NOTIFICATION_CONTENT_TYPES
ADD CONSTRAINT NOTIFICATION_CONTENT_TYPE_UK1 UNIQUE
(NAME);

If I export the database to XML it produces the following:

<table name="NOTIFICATION_CONTENT_TYPES">
      <column name="ID" primaryKey="true" required="true" type="INTEGER" size="1024" autoIncrement="false"/>
      <column name="NAME" primaryKey="false" required="true" type="VARCHAR" size="500"
autoIncrement="false"/>
      <column name="DESCRIPTION" primaryKey="false" required="true" type="VARCHAR" size="1000"
autoIncrement="false"/>
      <column name="NAMESPACE" primaryKey="false" required="true" type="VARCHAR" size="1000"
autoIncrement="false"/>
      <unique name="NOTIFICATION_CONTENT_TYPE_UK1">
        <unique-column name="NAME"/>
      </unique>
 </table>

If I subsequently use that XML to recreate the table it doesn't appear as if the UNIQUE key
is created (a subsequent export produces XML without the <unique> element.


> Add support for unique constraints
> ----------------------------------
>
>                 Key: DDLUTILS-85
>                 URL: http://issues.apache.org/jira/browse/DDLUTILS-85
>             Project: DdlUtils
>          Issue Type: New Feature
>          Components: Core (No specific database)
>            Reporter: Przemyslaw Sztoch
>         Assigned To: Thomas Dudziak
>             Fix For: 1.1
>
>
> For example in PostgreSQL we can create CONSTRAINT or INDEX. What will be generated,
should be set somewhere in model or config.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message