[Flow] policy role foregin key error

Robin Mansholt mansholt.robin at web.de
Sat Sep 20 20:27:45 CEST 2014


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!



More information about the Flow mailing list