Ashish Awasthi
Ashish Awasthi

Reputation: 1502

Database does not have any mapping information Symfony2 Doctrine

NOTE: Its not a Duplicate issue cause I have tried everything I get on google but nothing have helped us.

I am trying to import Tables using Doctrine Reverse Engineering tool, but I m getting this message:

Database does not have any mapping information.

My Connection Details in Config.yml

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   pdo_mysql
                host:     localhost
                port:     null
                dbname:   pixel_ashish
                user:     root
                password: abc123
                charset:  UTF8
                schema_filter: ~^(?!some_table1|some_table2)~
    orm:
            default_entity_manager:  default
            auto_generate_proxy_classes:  true
            proxy_dir:            "%kernel.cache_dir%/doctrine/orm/Proxies"
            proxy_namespace:      Proxies
            resolve_target_entities: []

What I have tried So Far:

  1. Running php app/console doctrine:mapping:import --force AcmeBlogBundle xml gives same error
  2. Tried to convert mapping also which does not make any sense cause mappings are not there but still tried didn't worked out.
  3. Created a new project and tried above given configuration didn't worked.

Now I am out of ideas please help me to solve this.

Upvotes: 2

Views: 4335

Answers (1)

Michael Sivolobov
Michael Sivolobov

Reputation: 13240

You need to create some mapping information in your config.

You can do it by passing auto_mapping: true under orm section:

doctrine:
    orm:
        auto_mapping: true

or by manually defining it under orm section:

doctrine:
    orm:
        default_entity_manager: default
        entity_managers:
            default:
                connection: default
                mappings:
                    YourBundleName:
                        type: "xml"
                        dir:  "Entity"
                        prefix: "Your\BundleName\Entity"

Upvotes: 0

Related Questions