Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see the auto-generated SQL query for DB schema update with Doctrine2 and Symfony2?

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

php app/console doctrine:generate:entities Acme

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

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?

Thanks in advance.

like image 660
JeanValjean Avatar asked Apr 22 '12 09:04

JeanValjean


1 Answers

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

like image 65
xanido Avatar answered Oct 18 '22 08:10

xanido