Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-961

First letters are missing in M:N tables

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1, 2.1
    • Component/s: Tools
    • Security Level: All
    • Labels:
      None
    • Environment:
      Windows, MySQL

      Description

      When I define M:N relation and update the schema by SchemaTool then the joining table is created without first letters (e.g. rticle_ag instead of article_tag). Relevant part from the source code:

      <?php
      /** @entity */
      class Article {
      	/** @manyToMany(targetEntity="Tag") */
      	public $tags;
      }
      
      /** @entity */
      class Tag {
      	/** @manyToMany(targetEntity="Article", mappedBy="tags") */
      	public $articles;
      }
      
      $tool = new \Doctrine\ORM\Tools\SchemaTool($em);
      $tool->updateSchema(array(
      	$em->getClassMetadata('Article'),
      	$em->getClassMetadata('Tag'),
      ));
      ?>
      

      You can download the complete example at http://www.notorm.com/static/doctrine2-notorm/

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Your entities are not namespaced are they?

        Show
        Benjamin Eberlei added a comment - Your entities are not namespaced are they?
        Hide
        Benjamin Eberlei added a comment -

        Yes, this is related to entities in global namespaces only. That is why nobody realized it before.

        Fixed now.

        Show
        Benjamin Eberlei added a comment - Yes, this is related to entities in global namespaces only. That is why nobody realized it before. Fixed now.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Jakub Vrána
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: