当我php app/console doctrine:schema:update --force
在 symfony 项目中运行时出现错误,我收到以下错误:
[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
这是生成的 sql,它给出了错误:
DROP INDEX idx-id ON extra
错误是索引名称没有用“`”包裹,我怎样才能得到它,所以索引名称总是用“`”包裹?