   INDEX `fk_film_idx` (`idFilm` ASC),
   INDEX `fk_account_idx` (`idAccount` ASC),
   PRIMARY KEY (`idRating`),
+  UNIQUE INDEX `rat` (`idAccount` ASC, `idFilm` ASC),
   CONSTRAINT `fk_film`
     FOREIGN KEY (`idFilm`)
     REFERENCES `moviewatch`.`Film` (`idFilm`)

    ON UPDATE NO ACTION)
ENGINE = InnoDB;

USE `moviewatch`;

DELIMITER $$

USE `moviewatch`$$
DROP TRIGGER IF EXISTS `moviewatch`.`COPY_FILM_TO_CATALOG` $$
USE `moviewatch`$$
CREATE DEFINER = CURRENT_USER TRIGGER `moviewatch`.`COPY_FILM_TO_CATALOG` AFTER INSERT ON `FilmCatalog` FOR EACH ROW
BEGIN

END
$$


DELIMITER ;
SET SQL_MODE = '';
GRANT USAGE ON *.* TO appuser;
 DROP USER appuser;

-- MySQL Script generated by MySQL Workbench
-- Tue May 12 22:15:11 2015
-- Model: New Model    Version: 1.0
-- MySQL Workbench Forward Engineering

