title: #1022 - Can't write; duplicate key in table
body: <p>Hi i am I'm getting a 1022 error on create tables in mysql phpMyAdmin.
  the error is on the last table "usercoment":</p>
  
  <p>SOLUTION EDIT:Ok,I had already a Constraint key named <code>IdMovie</code>,so i renamed and it works fine .
  Thank you guys.</p>
  
  <p>Here are the tables:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `WhichMovie`.`UserComent` (
    `IDComent` INT NOT NULL,
    `IDUser` INT NOT NULL,
    `IDMovie` INT NOT NULL,
    `date` TIMESTAMP NOT NULL,
    PRIMARY KEY (`IDComent`, `IDUser`, `IDMovie`, `date`),
    INDEX `idUser_idx` (`IDUser` ASC),
    INDEX `idMovie_idx` (`IDMovie` ASC),
    CONSTRAINT `IdComent`
      FOREIGN KEY (`IDComent`)
      REFERENCES `WhichMovie`.`Coment` (`idComent`)
      ON DELETE CASCADE
      ON UPDATE CASCADE,
    CONSTRAINT `IiUser`
      FOREIGN KEY (`IDUser`)
      REFERENCES `WhichMovie`.`User` (`idUser`)
      ON DELETE CASCADE
      ON UPDATE CASCADE,
    CONSTRAINT `IdMovie`
      FOREIGN KEY (`IDMovie`)
      REFERENCES `WhichMovie`.`Movie` (`idMovie`)
      ON DELETE CASCADE
      ON UPDATE CASCADE)
  ENGINE = InnoDB;
  
  -- -----------------------------------------------------
  -- Table `WhichMovie`.`Movie`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `WhichMovie`.`Movie` (
    `idMovie` INT NOT NULL AUTO_INCREMENT,
    `Ttle` VARCHAR(45) NULL,
    `Year` INT NULL,
    `Country` VARCHAR(45) NULL,
    `Poster` BLOB NULL,
    `Rating` DECIMAL NULL,
    PRIMARY KEY (`idMovie`))
  ENGINE = InnoDB;
  
  -- -----------------------------------------------------
  -- Table `WhichMovie`.`User`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `WhichMovie`.`User` (
    `idUser` INT NOT NULL AUTO_INCREMENT,
    `Username` VARCHAR(45) NOT NULL,
    `Email` VARCHAR(45) NOT NULL,
    `Country` VARCHAR(45) NULL,
    `Pass` VARCHAR(45) NOT NULL,
    PRIMARY KEY (`idUser`, `Username`, `Email`),
    UNIQUE INDEX `idUser_UNIQUE` (`idUser` ASC),
    UNIQUE INDEX `Email_UNIQUE` (`Email` ASC),
    UNIQUE INDEX `Username_UNIQUE` (`Username` ASC))
  ENGINE = InnoDB;
  
  -- -----------------------------------------------------
  -- Table `WhichMovie`.`Coment`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `WhichMovie`.`Coment` (
    `idComent` INT NOT NULL AUTO_INCREMENT,
    `NameComent` VARCHAR(45) NULL,
    PRIMARY KEY (`idComent`),
    UNIQUE INDEX `idComent_UNIQUE` (`idComent` ASC))
  ENGINE = InnoDB;
  </code></pre>
  
  <p>Can anyone see it ?</p>