hey guys, i’ve run into a problem. at page 198 i had to fill in the tbl_project_user_role and thereafter change the testIsInRole(). The problem is when i run the test, i get this error:
- ProjectTest::testDelete
CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (trackstar_test
.tbl_project_user_role
, CONSTRAINT tbl_project_user_role_ibfk_1
FOREIGN KEY (project_id
) REFERENCES tbl_project
(id
))
i then see this problem is a solved issue at this forum, but i don’t understand the solution:
Informational Note: Page 198 -
You might need to define the foreign key relationship on tbl_project_user_role.project_id to automatically handle deletes of rows in the project table. Otherwise, you might get a constraint violation error when the unit test ProjectTest::testDelete() is run.
in MySQL, something like
ON DELETE CASCADE ON UPDATE CASCADE
can anyone please help me understand that solution?