andrewblake1 / WorksManagement

Project/Works management system for Northpower's Westcoast Energy
0 stars 3 forks source link

Foreign key constraint when trying to delete Project #477

Closed hawea closed 9 years ago

hawea commented 9 years ago

Hi Andrew,

To recreate the bug, please do the following:

  1. Click on this link: http://dev.melbourne.wcewm.co.nz/Project/admin?client_id=2
  2. Click on the rubbish bin/delete icon next to project 675.
  3. Following error will occur:

System admin error! 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 (worksmanagement_melbourne_dev.tbl_task_to_material_to_assembly_to_material_group, CONSTRAINT fk_tbl_task_to_material_to_assembly_to_material_group_tbl_tas1 FOREIGN KEY (task_id, task_). The SQL statement executed was: DELETE FROMtbl_projectWHEREtbl_project.id`='675'