Created
November 30, 2012 12:16
-
-
Save mrimann/4175455 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use TYPO3\Flow\Annotations as Flow; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* A User | |
* | |
* @Flow\Entity | |
*/ | |
class User { | |
/** | |
* @var \TYPO3\Flow\Security\Account | |
* @ORM\ManyToOne | |
*/ | |
protected $account; |
(errno: 150) means: "You want to add a contraint over two different field types (for exemple the fields have a different encoding or one is int(10) and the other int(11),...)
If someone stumbles upon this issue: It could be solved by deleting the table and re-creating it with utf-8 definition - then a doctrin:update ran through without any further problem.
Since 2.3 Doctrine adds charset/collation information, overriding the default from the DB that was used before. If those do not match, it breaks. Recommended way around this: use migrations, rather than update and make sure the charset data matches (or remove it to use the DB default).
Oh, and always remember: SHOW ENGINE INNODB STATUS is your best friend when you hit error 150…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Anyone a clue, why this causes the following error message when running
./flow doctrine:update
? (I tried deleting this user-table and also deleting all tables of that database - didn't help so far):