Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-627

Unexpected Duplicate Field Mapping Exception

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-BETA3
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None
    • Environment:

      Description

      Trying to generate entities with annotation mappings using the CLI orm:convert-mapping command will throw an exception.

      – Schema to reproduce
      CREATE DATABASE IF NOT EXISTS `doctrine_issue`;
      USE `doctrine_issue`;
      CREATE TABLE `activity` (
      `idact` int(10) unsigned NOT NULL AUTO_INCREMENT,
      PRIMARY KEY (`idact`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
      CREATE TABLE `activity_log` (
      `idacl` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `idact` int(10) unsigned NOT NULL,
      PRIMARY KEY (`idacl`),
      CONSTRAINT `fk_activity_data_activity` FOREIGN KEY (`idact`) REFERENCES `activity` (`idact`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

      // configure a simple doctrine.php file to connect and run the following CLI command:
      C:\>php doctrine.php orm:convert-mapping --from-database annotation .\Entities

      Will throw an MappingException::duplicateFieldMapping on ActivityLog::idact, at line 1064 of class Doctrine\ORM\Mapping\ClassMetadataInfo

        Issue Links

          Activity

          Hide
          Cosmo added a comment -

          Hi, I've got this exact issue in 2.1.0BETA1. Any idea how to work around it?

          Show
          Cosmo added a comment - Hi, I've got this exact issue in 2.1.0BETA1. Any idea how to work around it?
          Hide
          Benjamin Eberlei added a comment -

          Fixed and scheduled for BETA 3

          Show
          Benjamin Eberlei added a comment - Fixed and scheduled for BETA 3

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Alexandre Brina
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: