如何使用Doctrine2和Symfony2查看自动生成的SQL架构更新SQL查询?

时间:2022-09-24 06:46:53

I added some DB tables in my Symfony2 project. Then, I used the following command:

我在Symfony2项目中添加了一些数据库表。然后,我使用以下命令:

php app/console doctrine:generate:entities Acme

to update the classes. Then, I tried to update the MySQL DB by using the following command:

更新类。然后,我尝试使用以下命令更新MySQL DB:

php app/console doctrine:schema:update --force

However, I get the following error message

但是,我收到以下错误消息

[PDOException]                                                                              
SQLSTATE[42000]: Syntax error or access violation: 1064 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
'like TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_8EA4B675A76ED3' at line 1  

How can I see which SQL query is wrong? Where the auto generate SQL queries are put?

如何查看哪个SQL查询错误?自动生成SQL查询的位置是什么?

Thanks in advance.

提前致谢。

1 个解决方案

#1


25  

Run php app/console doctrine:schema:update --dump-sql

运行php app / console doctrine:schema:update --dump-sql

#1


25  

Run php app/console doctrine:schema:update --dump-sql

运行php app / console doctrine:schema:update --dump-sql