I have an error when I run php app/console doctrine:schema:update --force
in a symfony project and i get the following error:
[Doctrine\DBAL\DBALException]
An exception occurred while executing 'DROP INDEX idx-id ON extra':
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-id ON extra' at line 1
[Doctrine\DBAL\Driver\Mysqli\MysqliException]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-id ON extra' at line 1
This is the generated sql that gives the error:
DROP INDEX idx-id ON extra
The error is that the index name is not wrapped with "`" , how can I get it so the index name is always wrapped with "`" ?
This is was a design decision:
Assuming you're now letting Doctrine name your indexes, my suggestion would be to rename (or drop) the index manually and then run the schema update.