Symfony gives me headache

Symfony really gives me headache sometimes. It took me an hour to figure it out this time. This was my problem:
When executing the command

php symfony doctrine:build --all

I got this error:

SQLSTATE[HY000]: General error: 1005 Can't create table

It may be that you are trying to set a relation between two tables but the references have different types. In Symfony 1.2 sfDoctrineGuardPlugin use a integer(4) (INTEGER) as primary key. In Symfony 1.4 sfDoctrineGuardPlugin use a integer(4) (BIGINT) as primary key.

It’s a good thing to know and I hope you didn’t spend that much time trying to solve this yourself. Blog about this article to help others.

One comment

  • 1
    Yeti
    februari 8, 2010 - 23:33 | Permalink

    If you call the command with -t switch, you will get a trace whenever an error occurs. This greatly helps in finding the relevant Table.

  • Kommentera

    E-postadressen publiceras inte. Obligatoriska fält är märkta *

    *

    *


    Följande HTML-taggar och attribut är tillåtna: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>