You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to define unique constraint in ORM\Table() annotation, it didn't even created any setting in migration. Then I tried to define it in separated annotation like #[ORM\UniqueConstraint] and it worked.
#[ORM\Table(
name: 'address',
uniqueConstraints: [
new ORM\UniqueConstraint(name: 'UNIQUE_id_public', fields: ['id_public']), // Doesn't work
new ORM\UniqueConstraint(name: 'UNIQUE_primary', fields: ['id', 'primary'])
]
)]
#[ORM\UniqueConstraint(name:'UNIQUE_id_public', fields: ['publicId'])] // Works
Am I doing something wrong, or is it expected behavior?
The text was updated successfully, but these errors were encountered:
Bug Report
Error in unique constraint definition
Summary
When I tried to define unique constraint in
ORM\Table()
annotation, it didn't even created any setting in migration. Then I tried to define it in separated annotation like #[ORM\UniqueConstraint] and it worked.Am I doing something wrong, or is it expected behavior?
The text was updated successfully, but these errors were encountered: