I am working with Symfony2 and Doctrine ORM using MySql .
After creating an Entity, I am not able to create the table. It throws an exception.
anu@anu-bridge:/var/www/Symfony$ php app/console doctrine:schema:update --force --dump-sql [Doctrine\DBAL\Schema\SchemaException] The table with name 'product' already exists. doctrine:schema:update [--complete] [--dump-sql] [--force] [--em[="..."]]
I tried to drop it , but still it throws the error.
anu@anu-bridge:/var/www/Symfony$ php app/console doctrine:schema:drop --force Dropping database schema... [Doctrine\DBAL\Schema\SchemaException] The table with name 'product' already exists. doctrine:schema:drop [--dump-sql] [--force] [--full-database] [--em[="..."]] [Doctrine\DBAL\Schema\SchemaException] The table with name 'product' already exists.
There is no tables in the database. Cleared all the cache for symfony and doctrine, but still the error is throwing.
Symfony2 version is 2.0.1 .
I've had a similar problem. Most likely you have two entities named Category inside different Bundles. For instance:
src/Acme/SomeBundle/Entity/Product.php src/Acme/OtherBundle/Entity/Product.php
Comment one of these files and retry the console command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With