[Flow] policy role foregin key error

Rémy DANIEL dogawaf at no-log.org
Sun Sep 21 01:54:07 CEST 2014


Hi

I think I had this issue one time.
My database was not created with the same default charset than my
application's table.
So, you could check this with by comparing the charset of "SHOW CREATE
DATABASE test" and "SHOW CREATE TABLE test.typo3_forum_domain_model_group
_grouproles_join".

Also, you could check your disk space.
I sometimes have weird mysql errors when my VM went out of disk space.

Regards

--
Rémy

2014-09-20 20:27 GMT+02:00 Robin Mansholt <mansholt.robin at web.de>:

> Hi,
>
> I'm working on an groupManagement and get in migration following error:
>
> /flow doctrine:migrate
>
> Uncaught Exception
>  An exception occurred while executing 'ALTER TABLE
>  typo3_forum_domain_model_group_grouproles_join ADD CONSTRAINT
>  FK_EB569AEF23A1047C FOREIGN KEY (flow_policy_role) REFERENCES
>  typo3_flow_security_policy_role (identifier)':
>
>  SQLSTATE[HY000]: General error: 1005 Can't create table
>  'test.#sql-e67_d8' (errno: 150)
>
> More Information
>  Exception code      #0
>  File                /var/www/forum/Packages/Libraries/doctrine/dbal/lib/
> Doctrine/DBAL/DBALException.php line 47
>
>
>
> InnoDB Monitor Output:
> ------------------------
> LATEST FOREIGN KEY ERROR
> ------------------------
> 140920 19:30:35 Error in foreign key constraint of table test/#sql-e67_a7:
> FOREIGN KEY (flow_policy_role) REFERENCES typo3_flow_security_policy_role
> (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 dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html
> for correct foreign key definition.
>
>
> In my Group Model:
>
> /**
> * @ORM\ManyToMany
> * @var \Doctrine\Common\Collections\Collection<\TYPO3\Flow\
> Security\Policy\Role>
> */
> protected $groupRoles;
>
>
>
> Some Mysql Informations:
>
> mysql> describe typo3_flow_security_policy_role;
> +------------+--------------+------+-----+---------+-------+
> | Field      | Type         | Null | Key | Default | Extra |
> +------------+--------------+------+-----+---------+-------+
> | identifier | varchar(255) | NO   | PRI | NULL    |       |
> | sourcehint | varchar(6)   | NO   |     | NULL    |       |
> +------------+--------------+------+-----+---------+-------+
> 2 rows in set (0.00 sec)
>
> mysql> describe typo3_forum_domain_model_group_grouproles_join;
> +------------------+--------------+------+-----+---------+-------+
> | Field            | Type         | Null | Key | Default | Extra |
> +------------------+--------------+------+-----+---------+-------+
> | forum_group      | varchar(40)  | NO   | PRI | NULL    |       |
> | flow_policy_role | varchar(255) | NO   | PRI | NULL    |       |
> +------------------+--------------+------+-----+---------+-------+
> 2 rows in set (0.00 sec)
>
> mysql> CHECK TABLE typo3_forum_domain_model_group_grouproles_join;
> +-----------------------------------------------------+-----
> --+----------+----------+
> | Table                                               | Op    | Msg_type |
> Msg_text |
> +-----------------------------------------------------+-----
> --+----------+----------+
> | test.typo3_forum_domain_model_group_grouproles_join | check | status
>  | OK       |
> +-----------------------------------------------------+-----
> --+----------+----------+
> 1 row in set (0.00 sec)
>
> mysql> CHECK TABLE typo3_flow_security_policy_role;
> +--------------------------------------+-------+----------+----------+
> | Table                                | Op    | Msg_type | Msg_text |
> +--------------------------------------+-------+----------+----------+
> | test.typo3_flow_security_policy_role | check | status   | OK       |
> +--------------------------------------+-------+----------+----------+
> 1 row in set (0.00 sec)
>
>
> I am looking a very long time for a solution of the problem.
> Do you have any hints for me?
>
> regards Robin!
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>


More information about the Flow mailing list