简体   繁体   English

如何强迫学说读取新的映射信息

[英]How to force Doctrine to read new mapping information

I am working on a Symfony project that uses the Sonata bundle. 我正在使用Sonata捆绑软件的Symfony项目中工作。 I have just added the following to my Page.orm.xml file: 我刚刚将以下内容添加到我的Page.orm.xml文件中:

    <many-to-many field="equivalents" target-entity="AppBundle\Entity\Equivalent">
        <cascade>
            <cascade-all />
        </cascade>
        <join-table name="page_equivalent">
                <join-columns>
                    <join-column name="page_id" referenced-column-name="id" />
                </join-columns>
                <inverse-join-columns>
                    <join-column name="equivalent_id" referenced-column-name="id" unique="true" />
                </inverse-join-columns>
        </join-table>
    </many-to-many>

... and I find that when I run app/console doctrine:schema:update --dump-sql I get a message telling me that my schema is up to date, even though it clearly is not. ...,我发现当我运行app/console doctrine:schema:update --dump-sql我收到一条消息,告诉我我的架构是最新的,即使显然不是最新的。

Am I misusing this command? 我是否滥用此命令? If so, is there another way of generating the necessary new table? 如果是这样,还有另一种方法来生成必要的新表吗?

This turned out to be a duplicate of Symfony doctrine:schema:update not working 原来这是Symfony主义的副本:schema:update无法正常工作

I found that running php app/console doctrine:cache:clear-metadata solved the problem. 我发现运行php app/console doctrine:cache:clear-metadata解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM