$model = StuMaster::findOne($id);
$address = StuAddress::findOne($model->stu_master_stu_address_id);
$info = StuInfo::findOne($model->stu_master_stu_info_id);
$pastacademics = StuPastacademics::findOne(['pastacad_studenid' => $info->stu_unique_id]);
$guardians = StuGuardians::findAll(['guardia_stu_master_id' => $model->stu_master_id]);
$pastacademics->delete();
$model->delete();
$info->delete();
完整性约束违规 - yii \ db \ IntegrityException
SQLSTATE [23000]:完整性约束违规:1451无法删除或更新父行:外键约束失败(whizzee_dihedblat
。stu_info
,CONSTRAINT stu_info_ibfk_3
FOREIGN KEY({{ 1}})参考stu_info_stu_master_id
(stu_master
))
正在执行的SQL是:DELETE FROM stu_master_id
WHERE stu_master
= 61