我试图以这种方式使用 Doctrine 对数据库进行逆向工程:
php app/console doctrine:mapping:convert xml ./src/Acme/TxBundle/Resources/config/doctrine/metadata/orm --from-database --force
或者也这样(遇到同样的问题):
php app/console doctrine:mapping:import TxBundle
但我总是收到以下错误:
PHP Fatal error: Call to a member function getColumns() on a non-object in /var/www/Symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php on line 134
Fatal error: Call to a member function getColumns() on a non-object in /var/www/Symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php on line 134
看来我有一些没有主键的表,我需要知道是否可以让 Doctrine 使用这些表而不改变表结构以添加所需的 PK?