There is a base of baths with the following EER Chart enter image description here

An error occurs during the Forward Engineer :

ERROR: Error 1060: Duplicate column name 'vendor_fk'

SQL Code:

 -- ----------------------------------------------------- -- Table `my_schema_1`.`Phone` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `my_schema_1`.`Phone` ( `phone_id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `vendor_fk` INT UNSIGNED NOT NULL, `ram_fk` INT UNSIGNED NOT NULL, PRIMARY KEY (`phone_id`, `vendor_fk`, `ram_fk`, `vendor_fk`, `ram_fk`), UNIQUE INDEX `phone_id_UNIQUE` (`phone_id` ASC), INDEX `fk_Phone_Vendor_idx` (`vendor_fk` ASC), INDEX `fk_Phone_RAM_idx` (`ram_fk` ASC), CONSTRAINT `fk_Phone_Vendor` FOREIGN KEY (`vendor_fk`) REFERENCES `my_schema_1`.`Vendor` (`vendor_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Phone_RAM` FOREIGN KEY (`ram_fk`) REFERENCES `my_schema_1`.`RAM` (`ram_id`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB 

SQL script execution finished: statements: 8 succeeded, 1 failed

Fetching back view definitions in final form. Nothing to fetch

    1 answer 1

    Here are the columns with duplicates:

      PRIMARY KEY (`phone_id`, `vendor_fk`, `ram_fk`, `vendor_fk`, `ram_fk`), 

    Try this:

      PRIMARY KEY (`phone_id`, `vendor_fk`, `ram_fk`), 
    • Curious for what a minus. The problem is exactly that. The decision is not the fact that you need exactly this, but it is one of the options. - D-side