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 connection in config_dev.yml
doctrine:
dbal:
default_connection: default
connections:
default:
driver: pdo_mysql
host: localhost
dbname: database1
user: root
password:
buv:
driver: pdo_mysql
host: localhost
dbname: database2
user: root
password:
I tried to import the schema with the following command:
$ php app/console doctrine:mapping:import --em=buv MyBundle yml
[DoctrineDBALSchemaSchemaException]
Index '' does not exist on table 'old_table'
But some of the tables in database2 have no PKs! And the full import dosn't work. But I only want to import two tables, so I tried:
$ php app/console doctrine:mapping:import --em=buv --filter="tablename" MyBundle yml
But I'm getting the same error, seems that --filter isn't working.
The documentation in the console command doctrine:mapping:import
only says to put the entity name in the filter option. But I don't have an entity yet.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…