如何解决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 举报,一经查实,本站将立刻删除。