Browse Source

Add unique constraint to the tag table

Jordi Boggiano 12 years ago
parent
commit
c1bfda6107
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/Packagist/WebBundle/Entity/Tag.php

+ 4 - 1
src/Packagist/WebBundle/Entity/Tag.php

@@ -19,7 +19,10 @@ use Doctrine\ORM\EntityManager;
 
 /**
  * @ORM\Entity
- * @ORM\Table(name="tag")
+ * @ORM\Table(
+ *     name="tag",
+ *     uniqueConstraints={@ORM\UniqueConstraint(name="name_idx", columns={"name"})}
+ * )
  * @author Jordi Boggiano <j.boggiano@seld.be>
  */
 class Tag