【发布时间】:2013-08-30 09:54:14
【问题描述】:
当我在 symfony 项目中运行 php app/console doctrine:schema:update --force 时出现错误,我收到以下错误:
[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
错误是索引名没有用“`”包裹, 我怎样才能得到它,以便索引名称总是用“`”包裹?
【问题讨论】:
标签: php mysql symfony doctrine-orm dbal