mysql foreign key ERROR 1451 update cascade not happening -


i trying update field referenced foreign key in table.

mysql> update maintenance set contract='95096916-old' contract='95096916';

error 1451 (23000): cannot delete or update parent row: foreign key constraint fails (systems_doc.equipment, constraint equipment_ibfk_1 foreign key (contract) references maintenance (contract) on update cascade)

| maintenance | create table `maintenance` (   `contract` char(30) not null,   `quote` char(30) not null,   `vendor` char(20) not null,   `provider` char(20) not null,   `product` char(30) not null,   `expirydate` date not null,   `annualcost` int(11) not null,   `reference` char(13) not null,   `purchaseorder` char(13) not null,   `cq` char(10) not null,   `cqrenewal` char(10) not null,   `comments` char(40) not null,   unique key `contract` (`contract`,`expirydate`) ) engine=innodb default charset=latin1 |   | equipment | create table `equipment` (   `vendor` char(20) not null,   `model` char(30) not null,   `serialnumber` char(20) not null,   `purchaseorder` char(20) not null,   `purchasedate` date not null,   `contract` char(15) not null,   `annualcost` int(11) not null,   `comments1` varchar(256) default null,   `comments2` varchar(256) not null,   primary key (`serialnumber`),   key `contract` (`contract`),   constraint `equipment_ibfk_1` foreign key (`contract`) references `maintenance` (`contract`) on update cascade ) engine=innodb default charset=latin1 |  

why isn't cascading update? don't think it's circular. help. i've read other similar problems, either misinterpreting how should work, or i've got setup wrong.


Comments