DDC-1317: @Column(unique=true) is not semantically equivalent to @UniqueConstraint and yields invalid SQL for table create statements #1653

Closed
opened 2026-01-22 13:21:12 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 3, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @jmikola:

Benjamin told me that @Column(unique=true) should be semantically equivalent to @UniqueConstraint within @Table; however, I am seeing invalid table creation SQL generated when using the @Column alternative. I am using MySQL and InnoDB.

Our submodule pointer was between 2.1.0BETA and 2.1.0RC1, so I marked this against version 2.0.6.

The example class and console output (when attempting an automatic schema update) may be found here: https://gist.github.com/1123476

Originally created by @doctrinebot on GitHub (Aug 3, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @jmikola: Benjamin told me that @Column(unique=true) should be semantically equivalent to @UniqueConstraint within @Table; however, I am seeing invalid table creation SQL generated when using the @Column alternative. I am using MySQL and InnoDB. Our submodule pointer was between 2.1.0BETA and 2.1.0RC1, so I marked this against version 2.0.6. The example class and console output (when attempting an automatic schema update) may be found here: https://gist.github.com/1123476
admin added the Bug label 2026-01-22 13:21:12 +01:00
admin closed this issue 2026-01-22 13:21:14 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 6, 2011):

Comment created by @beberlei:

The problem is that "key" is a mysql keyword. That is also the portion that fails in the SQL query error message, nothing related to the unique constraint.

@doctrinebot commented on GitHub (Aug 6, 2011): Comment created by @beberlei: The problem is that "key" is a mysql keyword. That is also the portion that fails in the SQL query error message, nothing related to the unique constraint.
Author
Owner

@doctrinebot commented on GitHub (Aug 6, 2011):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Aug 6, 2011): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1653