if I try to update primary key, which also is foreign key for other table (in gui interface ),
then primary key are not updated. (all tables have InnoDB type)
but if I update table through sql query, then both fields update normal.
update foreign keys
Code: Select all
CREATE TABLE `object` (
`object_id` int(10) unsigned NOT NULL auto_increment,
`obj_type` varchar(20) default NULL,
`max_action` tinyint(3) unsigned default NULL,
PRIMARY KEY (`object_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
CREATE TABLE `attributes` (
`attr_id` varchar(100) NOT NULL,
`component_id` int(11) unsigned NOT NULL,
`str_id` int(11) unsigned default NULL,
`object_id` int(10) unsigned default NULL,
`description` varchar(255) default NULL,
PRIMARY KEY (`attr_id`),
KEY `fk_attributes__object_id` (`object_id`),
CONSTRAINT `fk_attributes__object_id` FOREIGN KEY (`object_id`) REFERENCES `object` (`object_id`) ON UPDATE CASCADE,
) ENGINE=InnoDB DEFAULT CHARSET=utf8
I don't change column. I change some value in column. sql query "update" normally run. If I run query
then object_id columns change in both tables. But "edit table" mode can't change the value.
Code: Select all
update object set object_id=31 where object_id=33;