Symfony Sonata duplicated entities

I’m using Sonata on my Symfony project. I use media-bundle and classification-bundle. I added them with composer require. This added several Entities in my src/Entity like SonataClassificationCategory, SonataMediaMedia, etc. When I try to update my doctrine schema I have this error:

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

When looking on the Internet, there is a lot of posts on this, especially on github but nothing worked for me. I tried to modify my doctrine.yaml. Originally, it was like that:

    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: 'AppEntity'
            alias: App

So I tried something like that, I found this on 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: 'AppEntity'
                    alias: App
        other:
            naming_strategy: doctrine.orm.naming_strategy.underscore
            mappings:
                SonataMediaBundle: ~
                SonataClassificationBundle: ~

But I get the error

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

I looked at my database, and there is a column name with ‘slug’ in the table ‘classification__collection’. I’m kind of stuck here, I don’t know where to look and go.
Also, when I go on my website I have this error:

Warning: Use of undefined constant XML_PI_NODE - assumed 'XML_PI_NODE' (this will throw an Error in a future version of PHP)
                                                                                  

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *