Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1 DDL Export: add UNIQUE constaint for single columns

open
nobody
None
5
2009-12-21
2009-12-21
Maciej Mrozowski
No

Currently making column as UNIQUE does not have any effect on DDL. Patch makes it work with PostgreSQL. Please check it better as I'm not SQL wizard and may have missed something obvious.

Thanks

Discussion

  •  
    Attachments
  • I don't about other database systems, but in PostgreSQL at lest, all PRIMARY keys are implicitly UNIQUE so there's no need to add UNIQUE constrain for columns that are alone PRIMARY KEY.
    If so, there should be instead and also "Table information dialog" UNIQUE check box could be grayed for columns that alone PRIMARY KEY.

    if (!normalColumn.isPrimaryKey() && normalColumn.isUniqueKey()) {
    ddl.append(" UNIQUE");

     
  • Thank you for your patch.
    It is referenced at version 1.0.0.v20091221-1350

    about he relation between UNIQUE check box and alone PRIMARY KEY,
    I will consider.