[FLOW3-general] Doctrine Migration on Adding OneToOne Relationship to TYPO3.Media:Image
Cedric Ziel
cedric at cedric-ziel.com
Tue Nov 13 14:53:50 CET 2012
I just wanted to share the solution:
Keep away the local (RDBMS) parts from your migrations. In my case, the generated Migrations carried parts of the collation.
Because foreign keys heavily depend on congruence of the keys, the same data type is only one part. The Database checks for COMPLETE congruence. Means: if the referenced key doesn't have a default collation, your new FKs mustn't have one.
Maybe more related to Doctrine in general, but important enough to be mentioned.
Anyways.. Thank you for assistance!
Cedric Ziel <cedric at cedric-ziel.com> schrieb:
>Hi Karsten,
>
>thank you for the diagnostic command; I executed it and it shows the
>following:
>------------------------
>LATEST FOREIGN KEY ERROR
>------------------------
>121113 9:41:53 Error in foreign key constraint of table
>car_dev/#sql-47f_fb:
> FOREIGN KEY (thumbnailpath) REFERENCES typo3_media_domain_model_image
>(persistence_object_identifier):
>Cannot find an index in the referenced table where the
>referenced columns appear as the first columns, or column types
>in the table and the referenced table do not match for constraint.
>Note that the internal storage type of ENUM and SET changed in
>tables created with >= InnoDB-4.1.12, and such columns in old tables
>cannot be referenced by such columns in new tables.
>See
>http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html
>for correct foreign key definition.
>
>As far as I understand, I need an index-but I do not know, how exactly
>this should be defined..
>
>
>Thank you in advance,
>Cedric
>
>Am 13.11.2012 09:36, schrieb Karsten Dambekalns:
>> Hi.
>>
>> On 13.11.12 01:02, Cedric Ziel wrote:
>>> SQLSTATE[HY000]: General error: 1005 Can't create table
>>> 'car_dev.#sql-47f_f8' (errno: 150)
>> The most important piece of MySQL knowledge when dealing with FK
>> constraints is how to get to the real error message:
>>
>> http://dev.mysql.com/doc/refman/5.1/en/show-engine.html
>>
>> Immediately after the error has occurred, run the following SQL:
>>
>> SHOW ENGINE INNODB STATUS
>>
>> This produces a lot of information, among them the last InnoDB error,
>> and that is way more helpful than the "can't create table" from
>above.
>>
>> See http://dev.mysql.com/doc/refman/5.1/en/innodb-monitors.html for
>an
>> explanation of all the InnoDB status output.
>>
>> Regards,
>> Karsten
>
>_______________________________________________
>FLOW3-general mailing list
>FLOW3-general at lists.typo3.org
>http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
Viele Grüße,
Cedric Ziel
--
Cedric Volker Ziel
Internetdienstleistungen & EDV
Robert-Koch-Str. 40
06110 Halle (Saale)
Mobil: +49-151-253-44-284
Mail: cedric at cedric-ziel.com
Web: http://www.cedric-ziel.com
More information about the FLOW3-general
mailing list