title: An index with name 'primary' was already defined on table 'sites'
body: <p>I am using Doctrine 2 with ZF2.</p>
  
  <p>I have a sites entity with the following primary key field.</p>
  
  <pre><code>/**
   * @var string
   * @ORM\Column(name="site_id", type="string", length=10, nullable=false)
   * @ORM\Id
   */
  private $siteId;
  </code></pre>
  
  <p>And the following index's</p>
  
  <pre><code>*   @ORM\Table(name="sites", indexes={
  *   @ORM\Index(name="PRIMARY", columns={"site_id"}),
  *   @ORM\Index(name="country_id", columns={"country_id"}),
  *   @ORM\Index(name="timezone_id", columns={"timezone_id"}),
  *   @ORM\Index(name="vat_rate_id", columns={"vat_rate_id"}),
  *   @ORM\Index(name="site_mode_id", columns={"site_mode_id"}),
  *   @ORM\Index(name="created_by_user_id", columns={"created_by_user_id"}),
  * })
  </code></pre>
  
  <p>When I run <code>php ./vendor/doctrine/doctrine-module/bin/doctrine-module orm:validate-schema</code> from the command line I get the following error message.</p>
  
  <pre><code>[Doctrine\DBAL\Schema\SchemaException]
    An index with name 'primary' was already defined on table 'sites'.
  </code></pre>
  
  <p>However it also reports <code>The mapping files are correct.</code></p>
  
  <p>Does anyone know why this error is being generated?</p>
  
  <p>Many thanks in advance.</p>
  
  <p>EDIT</p>
  
  <p>Full entity as requested</p>
  
  <pre><code>/**
   * Sites Entity
   *
   * @author Garry Childs
   *
   *   @ORM\Table(name="sites", indexes={
   *   @ORM\Index(name="country_id", columns={"country_id"}),
   *   @ORM\Index(name="timezone_id", columns={"timezone_id"}),
   *   @ORM\Index(name="vat_rate_id", columns={"vat_rate_id"}),
   *   @ORM\Index(name="site_mode_id", columns={"site_mode_id"}),
   *   @ORM\Index(name="created_by_user_id", columns={"created_by_user_id"}),
   * })
   * @ORM\Entity(repositoryClass="Application\Entity\Repository\SitesRepository")
   * @ORM\HasLifecycleCallbacks
   */
  class Sites extends AbstractEntity
  {
  
      /**
       * @var string
       * @ORM\Column(name="site_id", type="string", length=10, nullable=false)
       * @ORM\Id
       */
      private $siteId;
  
      /**
       * @var string
       *
       * @ORM\Column(name="domain_name", type="string", length=255, nullable=false)
       */
      private $domainName;
  
      /**
       * @var string
       *
       * @ORM\Column(name="title", type="string", length=30, nullable=false)
       */
      private $title;
  
      /**
       * @var string
       *
       * @ORM\Column(name="email_address", type="string", length=254, nullable=false)
       */
      private $emailAddress;
  
      /**
       * @var string
       *
       * @ORM\Column(name="layout", type="string", length=30, nullable=true)
       */
      private $layout;
  
      /**
       * @var string
       *
       * @ORM\Column(name="homepage", type="string", length=30, nullable=true)
       */
      private $homepage;
  
      /**
       * @var string
       *
       * @ORM\Column(name="bookmark_icon", type="string", length=20, nullable=false)
       */
      private $bookmarkIcon = 'bookmark.png';
  
      /**
       * @var string
       *
       * @ORM\Column(name="address", type="string", length=200, nullable=false)
       */
      private $address;
  
      /**
       * @var string
       *
       * @ORM\Column(name="town", type="string", length=30, nullable=false)
       */
      private $town;
  
      /**
       * @var string
       *
       * @ORM\Column(name="county", type="string", length=30, nullable=false)
       */
      private $county;
  
      /**
       * @var \Application\Entity\Countries
       *
       * @ORM\ManyToOne(targetEntity="Application\Entity\Countries")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="country_id", referencedColumnName="country_id")
       * })
       */
      private $country;
  
      /**
       * @var string
       *
       * @ORM\Column(name="post_code", type="string", length=7, nullable=false)
       */
      private $postCode;
  
      /**
       * @var \Application\Entity\Timezones
       *
       * @ORM\ManyToOne(targetEntity="Application\Entity\Timezones")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="timezone_id", referencedColumnName="timezone_id")
       * })
       */
      private $timezone;
  
      /**
       * @var string
       *
       * @ORM\Column(name="locale", type="string", length=5, nullable=false)
       */
      private $locale;
  
      /**
       * @var string
       *
       * @ORM\Column(name="currency_code", type="string", length=3, nullable=false)
       */
      private $currencyCode;
  
      /**
       * @var string
       *
       * @ORM\Column(name="vat_number", type="string", length=10, nullable=true)
       */
      private $vatNumber;
  
      /**
       * @var \Application\Entity\VatRates
       *
       * @ORM\ManyToOne(targetEntity="Application\Entity\VatRates", inversedBy="sites")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="vat_rate_id", referencedColumnName="vat_rate_id")
       * })
       */
      private $vatRate;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="date_created", type="datetime")
       */
      private $dateCreated;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="date_modified", type="datetime")
       */
      private $dateModified;
  
      /**
       * @var \Application\Entity\Users
       *
       * @ORM\ManyToOne(targetEntity="Application\Entity\Users")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="created_by_user_id", referencedColumnName="user_id")
       * })
       */
      private $createdBy;
  
      /**
       * @var Doctrine\ORM\PersistentCollection
       *
       * @ORM\OneToMany(targetEntity="Application\Entity\Categories", mappedBy="site")
       */
      private $categories;
  
      /**
       * @var \Doctrine\ORM\PersistentCollection
       *
       * @ORM\OneToMany(targetEntity="Application\Entity\SiteCountries", cascade="persist", mappedBy="site")
       */
      private $siteCountries;
  
      /**
       * @var \Doctrine\ORM\PersistentCollection
       *
       * @ORM\OneToMany(targetEntity="Application\Entity\SiteShippingMethods", cascade="persist", mappedBy="site")
       */
      private $shippingMethods;
  
      /**
       * @var \Doctrine\ORM\PersistentCollection
       *
       * @ORM\OneToMany(targetEntity="Application\Entity\SitePaymentMethods", cascade="persist", mappedBy="site")
       */
      private $sitePaymentMethods;
  
      /**
       * @var \Application\Entity\SiteModes
       *
       * @ORM\ManyToOne(targetEntity="Application\Entity\SiteModes")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="site_mode_id", referencedColumnName="site_mode_id")
       * })
       */
      private $siteMode;
  
      /**
       *
       * @var integer
       * @ORM\Column(name="payment_days", type="integer", nullable=false)
       */
      private $paymentDays;
  
      /**
       *
       * @var integer
       * @ORM\Column(name="products_per_page", type="integer", nullable=false)
       */
      private $productsPerPage;
  
      /**
       * @var \Doctrine\ORM\PersistentCollection
       *
       * @ORM\OneToMany(targetEntity="Application\Entity\Invoices", mappedBy="site")
       * })
       */
      private $invoices;
  
      public function __construct()
      {
          $this-&gt;categories = new ArrayCollection();
          $this-&gt;siteCountries = new ArrayCollection();
          $this-&gt;shippingMethods = new ArrayCollection();
          $this-&gt;vatRate = NULL;
          $this-&gt;sitePaymentMethods = new ArrayCollection();
          $this-&gt;invoices = new ArrayCollection();
          $this-&gt;productsPerPage = 15;
      }
  
      .... Getters &amp; Setters
  
      /**
       * @ORM\PrePersist
       * @return \Application\Entity\Users
       */
      public function prePersist()
      {
          $this-&gt;dateCreated = $this-&gt;getCurrentDateTime();
          $this-&gt;dateModified = $this-&gt;getCurrentDateTime();
          $this-&gt;currencyCode = $this-&gt;strToUpper($this-&gt;currencyCode);
          $this-&gt;createdBy = $this-&gt;getAuthUser();
          return $this;
      }
  
      /**
       * @ORM\PreUpdate
       * @return \Application\Entity\Users
       */
      public function preUpdate()
      {
          $this-&gt;dateModified = $this-&gt;getCurrentDateTime();
          $this-&gt;currencyCode = $this-&gt;strToUpper($this-&gt;currencyCode);
          return $this;
      }
  </code></pre>