[Solved] Add doctrine uniqueConstraints support

0 votes
asked Jul 7, 2017 in Solved by Guillaume (220 points)
recategorized Jul 25, 2017 by ludek.vodicka

Hey,

Is possible to add doctrine uniqueConstraints support like table, schema, repository-class ?

Working exemple :

@ORM\Table(uniqueConstraints={@UniqueConstraint(name="line_user_idx", columns={"line", "user_id"})})

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#annref-uniqueconstraint

For now i use table field and remove the quote...

Hacking...
Skipper table field value

phone",uniqueConstraints={@UniqueConstraint(name="line_user_idx", columns={"line", "user_id"})})

Output :

 * @ORM\Table(name="phone",uniqueConstraints={@UniqueConstraint(name="line_user_idx", columns={"line", "user_id"})})")

And remove last quote after each export...

Thk.

1 Answer

0 votes
answered Jul 25, 2017 by ludek.vodicka Skipper developer (140,450 points)
selected Jul 25, 2017 by Guillaume
 
Best answer

Hi Guillaume,

did you try Unique Indexes in Skipper?

enter image description here

/**
 * @ORM\Entity
 * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="line_user_idx", columns={"name"})})
 */
commented Jul 25, 2017 by Guillaume (220 points)

Thk !!!

...