Skip to content

Loading…

DDC-961: First letters are missing in M:N tables #5496

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user vrana:

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/

@doctrinebot

Comment created by @beberlei:

Your entities are not namespaced are they?

@doctrinebot

Comment created by @beberlei:

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

Fixed now.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0.1 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.