You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Przemyslaw Sztoch (JIRA)" <ji...@apache.org> on 2006/03/16 23:18:12 UTC

[jira] Created: (DDLUTILS-85) Unique index generated as index or as constraint.

Unique index generated as index or as constraint.
-------------------------------------------------

         Key: DDLUTILS-85
         URL: http://issues.apache.org/jira/browse/DDLUTILS-85
     Project: DdlUtils
        Type: New Feature
  Components: Core  
    Reporter: Przemyslaw Sztoch
 Assigned to: Thomas Dudziak 


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


[jira] Updated: (DDLUTILS-85) Add support for unique constraints

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DDLUTILS-85?page=all ]

Thomas Dudziak updated DDLUTILS-85:
-----------------------------------

    Fix Version: 1.1

> Add support for unique constraints
> ----------------------------------
>
>          Key: DDLUTILS-85
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-85
>      Project: DdlUtils
>         Type: New Feature

>   Components: Core
>     Reporter: Przemyslaw Sztoch
>     Assignee: 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


[jira] Updated: (DDLUTILS-85) Add support for unique constraints

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DDLUTILS-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Dudziak updated DDLUTILS-85:
-----------------------------------

    Fix Version/s:     (was: 1.1)
                   1.2

> Add support for unique constraints
> ----------------------------------
>
>                 Key: DDLUTILS-85
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-85
>             Project: DdlUtils
>          Issue Type: New Feature
>          Components: Core (No specific database)
>            Reporter: Przemyslaw Sztoch
>            Assignee: Thomas Dudziak
>             Fix For: 1.2
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DDLUTILS-85) Add support for unique constraints

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DDLUTILS-85?page=all ]

Thomas Dudziak updated DDLUTILS-85:
-----------------------------------

    Summary: Add support for unique constraints  (was: Unique index generated as index or as constraint.)

A unique index is not the same as a unique constraint. The latter is only intended to ensure that "combination of values in the indicated columns is unique across the whole table" to cite the PostgreSQL docs. The former adds an index on top of that.

> Add support for unique constraints
> ----------------------------------
>
>          Key: DDLUTILS-85
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-85
>      Project: DdlUtils
>         Type: New Feature
>   Components: Core
>     Reporter: Przemyslaw Sztoch
>     Assignee: Thomas Dudziak

>
> 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


[jira] Commented: (DDLUTILS-85) Add support for unique constraints

Posted by "John Fereira (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] Commented: (DDLUTILS-85) Add support for unique constraints

Posted by "Chris Hyzer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DDLUTILS-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617247#action_12617247 ] 

Chris Hyzer commented on DDLUTILS-85:
-------------------------------------

This is an important issue for me because I have foreign keys that dont relate to a primary key.  This works fine in mysql, but in oracle a unique index wont cut it.  Oracle will not add the foreign key for a unique index, it requires a unique or primary key.  So now my DDL has a bunch of errors in it.

Thanks!
Chris

> Add support for unique constraints
> ----------------------------------
>
>                 Key: DDLUTILS-85
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-85
>             Project: DdlUtils
>          Issue Type: New Feature
>          Components: Core (No specific database)
>            Reporter: Przemyslaw Sztoch
>            Assignee: Thomas Dudziak
>             Fix For: 1.2
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.