Home Documentation Download Pricing Buy Now

Unique Constraint and Doctrine Table Name Error

0 votes

Hello,

I have two entities in which I have created a Unique Constraint index. One table has a field called emailAccount . When I export to ORM and doctrine imports the Entity it creates the column as email_account. When the Annotations are created I get the following line

  • @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="TenantUniqueEmail", columns={"emailAddress","tenant_id","id"})})

emailAccount doesnt exist as a column name so I have to manually modify the file to state email_address. Is this expected behavior, or is there a way I can modify a config to include the table name and not the entity name?

Is this more of an issue with Doctrine?

Thanks for any help you have.

Seth

asked Jan 11, 2022 in Bug report by sethwhitworth (140 points)

1 Answer

0 votes

Hello,

In case you need to export a different column name than the field name, you can use the "column name" property in ORM property editor.

You're experiencing this issue probably because @UniqueConstrains needs to have column list, not field liest. So you need to configure your Colum name properly.

answered Jan 11, 2022 by ludek.vodicka Skipper developer (140,530 points)

This makes perfect sense. My apologies for classifying this as a bug.

Thanks for the help
Seth

...