DDC-236: uniqueConstraints annotation is not consistant with indexes annotation #291

Closed
opened 2026-01-22 12:33:38 +01:00 by admin · 5 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 4, 2010).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user rickdt:

It is not possible to name an unique constraint like we would do for an index.

If you look at ORM/Mapping/Driver/AnnotationDriver:99 in trunk, you will see that improvement done for index have not been ported to uniqueConstraints.

 if ($tableAnnot->indexes !== null) {
                foreach ($tableAnnot->indexes as $indexAnnot) {
                    $primaryTable['indexes'][$indexAnnot->name] = array('columns' => $indexAnnot->columns);
                }
            }

            if ($tableAnnot->uniqueConstraints !== null) {
                foreach ($tableAnnot->uniqueConstraints as $uniqueConstraint) {
                    $primaryTable['uniqueConstraints'][] = $uniqueConstraint->columns;
                }
            }
Originally created by @doctrinebot on GitHub (Jan 4, 2010). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user rickdt: It is not possible to name an unique constraint like we would do for an index. If you look at ORM/Mapping/Driver/AnnotationDriver:99 in trunk, you will see that improvement done for index have not been ported to uniqueConstraints. ``` if ($tableAnnot->indexes !== null) { foreach ($tableAnnot->indexes as $indexAnnot) { $primaryTable['indexes'][$indexAnnot->name] = array('columns' => $indexAnnot->columns); } } if ($tableAnnot->uniqueConstraints !== null) { foreach ($tableAnnot->uniqueConstraints as $uniqueConstraint) { $primaryTable['uniqueConstraints'][] = $uniqueConstraint->columns; } } ```
admin added the Improvement label 2026-01-22 12:33:38 +01:00
admin closed this issue 2026-01-22 12:33:39 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 5, 2010):

Comment created by @guilhermeblanco:

First attempt to fix unique naming issues and support.

@doctrinebot commented on GitHub (Jan 5, 2010): Comment created by @guilhermeblanco: First attempt to fix unique naming issues and support.
Author
Owner

@doctrinebot commented on GitHub (Jan 6, 2010):

Comment created by @guilhermeblanco:

Second attempt to fix this issue... unit tests are passing now.

Try to incorporate it and check if it works smoothly. I'll commit this as soon as I get a feedback from you.

Also Benjamin is reviewing it against all supported databases.

Cheers,

@doctrinebot commented on GitHub (Jan 6, 2010): Comment created by @guilhermeblanco: Second attempt to fix this issue... unit tests are passing now. Try to incorporate it and check if it works smoothly. I'll commit this as soon as I get a feedback from you. Also Benjamin is reviewing it against all supported databases. Cheers,
Author
Owner

@doctrinebot commented on GitHub (Jan 6, 2010):

Comment created by @guilhermeblanco:

In r7007 this issue was fixed.

Patch was tested successfully over SQLite, MySQL and PostgreSQL.
Oracle is ok also.

If you have any related problems, reopen the issue.

Cheers,

@doctrinebot commented on GitHub (Jan 6, 2010): Comment created by @guilhermeblanco: In r7007 this issue was fixed. Patch was tested successfully over SQLite, MySQL and PostgreSQL. Oracle is ok also. If you have any related problems, reopen the issue. Cheers,
Author
Owner

@doctrinebot commented on GitHub (Jan 6, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 6, 2010): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/e43c455b4d3be2af72c5

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/e43c455b4d3be2af72c5 - [10269_patch.diff](https://gist.github.com/e43c455b4d3be2af72c5#file-10269_patch-diff)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#291