Alex Rivera | Logout

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

Asked 2012-04-22T09:41:30.933
12

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.

Edit
Report

1 Answer

35

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

answered 2012-04-22T09:46:00.320

Your Answer