Importing tables from external database in Symfony2 with doctrine

前端 未结 8 935
醉酒成梦
醉酒成梦 2020-12-12 18:18

I have a Symfony2 project with its own database, and now I want to connect to another database (another project) so I can modify some tables.

I created the new conne

8条回答
  •  被撕碎了的回忆
    2020-12-12 18:53

    I've successfully imported some database entities by adding a schema_filter in the doctrine dbal config (~/app/config/config.yml)

    # Doctrine Configuration
    doctrine:
        dbal:
            driver:   %database_driver%
            host:     %database_host%
            port:     %database_port%
            dbname:   %database_name%
            user:     %database_user%
            password: %database_password%
            charset:  UTF8
            schema_filter: /^users_table/
    

    app/console doctrine:mapping:import --force MyBundle yml

    Then revert config.yml.

提交回复
热议问题