title: Doctrine ORM level difference between @UniqueConstraint and @Column(unique=true) options
body: <p>In database level, there is no difference when using one over another option for defining <strong>UNIQUENESS</strong> as shown below. Although <code>@UniqueConstraint</code> reads in its documentation "<em>It only has meaning in the SchemaTool schema generation context</em>", is there a ORM level difference in between? I mean when we run queries, do things get handled differently?</p>
  
  <ul>
  <li><a href="http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#uniqueconstraint" rel="noreferrer">@UniqueConstraint</a></li>
  <li><a href="http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#annref-column" rel="noreferrer">@Column</a> (unique=true)</li>
  </ul>
  
  <p><strong>EXAMPLE - @UniqueConstraint</strong></p>
  
  <p>CLASS</p>
  
  <pre><code>/**
   * @ORM\Entity
   * @ORM\Table(
   *      name="user",
   *      uniqueConstraints={
   *          @ORM\UniqueConstraint(columns={"email"})
   *      }
   * )
   */
  class User
  {
      /**
       * @ORM\Column(name="email", type="string", length=100)
       */
      private $email;
  }
  </code></pre>
  
  <p>DQL</p>
  
  <pre><code>CREATE TABLE `user` (
    `email` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
    UNIQUE KEY `UNIQ_8D93D649E7927C74` (`email`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  </code></pre>
  
  <p><strong>EXAMPLE - @Column - unique=true</strong></p>
  
  <p>CLASS</p>
  
  <pre><code>/**
   * @ORM\Entity
   * @ORM\Table(name="user")
   */
  class User
  {
      /**
       * @ORM\Column(name="email", type="string", length=100, unique=true)
       */
      private $email;
  }
  </code></pre>
  
  <p>DQL</p>
  
  <pre><code>CREATE TABLE `user` (
    `email` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
    UNIQUE KEY `UNIQ_8D93D649E7927C74` (`email`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  </code></pre>