Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Labels:
      None

      Description

      For example in PostgreSQL we can create CONSTRAINT or INDEX. What will be generated, should be set somewhere in model or config.

        Issue Links

          Activity

          Hide
          Thomas Dudziak added a comment -

          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.

          Show
          Thomas Dudziak added a comment - 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.
          Hide
          John Fereira added a comment -

          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.

          Show
          John Fereira added a comment - 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.
          Hide
          Chris Hyzer added a comment -

          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

          Show
          Chris Hyzer added a comment - 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

            People

            • Assignee:
              Thomas Dudziak
              Reporter:
              Przemyslaw Sztoch
            • Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development