Symfony Sonata复制实体

问题描述

我在Symfony项目中使用Sonata。我使用媒体捆绑和分类捆绑。我添加了他们与作曲家要求。这在我的src / Entity中添加了几个实体,例如SonataClassificationCategory,SonataMediaMedia等。当我尝试更新我的教义模式时,出现此错误:

In SchemaException.php line 111:
                                                           
The table with name 'intranet.media__media' already exists.  

在Internet上浏览时,有很多帖子,特别是在github上,但对我没有任何帮助。我试图修改doctrine.yaml。最初是这样的:

    orm:
    auto_generate_proxy_classes: true
    naming_strategy: doctrine.orm.naming_strategy.underscore
    auto_mapping: true
    mappings:
        App:
            is_bundle: false
            type: annotation
            dir: '%kernel.project_dir%/src/Entity'
            prefix: 'App\Entity'
            alias: App

所以我尝试了类似的方法,我在github上找到了它:

 orm:
    auto_generate_proxy_classes: true
    entity_managers:
        default:
            naming_strategy: doctrine.orm.naming_strategy.underscore
            auto_mapping: true
            mappings:
                App:
                    is_bundle: false
                    type: annotation
                    dir: '%kernel.project_dir%/src/Entity'
                    prefix: 'App\Entity'
                    alias: App
        other:
            naming_strategy: doctrine.orm.naming_strategy.underscore
            mappings:
                SonataMediaBundle: ~
                SonataClassificationBundle: ~

但是我得到了错误

In SchemaException.php line 85:
                                                                          
There is no column with name 'slug' on table 'classification__collection'.  
                                                                          

我查看了我的数据库,并且在表'classification__collection'中有一个带有'slug'的列名。我有点卡在这里,我不知道去哪里看看。 另外,当我进入网站时,一切正常。它实际上只与数据库有关。
我真的被卡住了。有人有主意吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...