The problem
With no previous migration pending I run:
app/console doctrine:migration:diff
app/console doctrine:migration:migrate
I got this error:
ALTER TABLE session ADD CONSTRAINT FK_9955C22EA76ED395 FOREIGN KEY (user_id) REFERENCES user(id)
Migration 20130320103822 failed during Execution. Error SQLSTATE[HY000]: General error: 1005 Can't create table 'mydb.#sql-3e4_75e0' (errno: 150)
[PDOException]
SQLSTATE[HY000]: General error: 1005 Can't create table 'mydb.#sql-3e4_75e0' (errno: 150)
Extra knowledge
- I'm declaring my Entity through annotation in class.
- This code is working (but I've to run manually a few operations that are not run after those kind of exception)
What I would like to know
- What's causing that bug ?
- Is there any way to fix it ? (through Doctrine update for example or some MySQL parameters)