symfony2已有数据表导入实体时报错 Doctrine does not support reverse engineering from tables that don't have a primary key
先在配置文件 app/config/config.yml中配置
schema_filter: /^(?!(tablename))/
即可,或者在出现问题表都加上一个id
然后再使用命令
php app/console doctrine:mapping:import LipinerAppapiBundle yml --force --filter="User"
可以把表名带有 user的表导出yml文件 如 sign_user user_log user 等都会导出yml文件到../Resource/config/doctrine/...
再使用生成实体命令
php app/console doctrine:generate:entities LipinerAppapiBundle