我需要更改數據庫表中行的順序。 我的表格有4列和7行。我需要重新排列這些行對數據庫中的行重新排序
pk_i_id int(10) unsigned Auto Increment
s_name varchar(255) NULL
s_heading varchar(255) NULL
s_order_type varchar(10) NULL
在Adminer,當我改變pk_i_id金額(數量)別的東西,我得到這個錯誤...
Cannot delete or update a parent row: a foreign key constraint fails (`database_name`.`oc_t_item_custom_attr_categories`, CONSTRAINT `oc_t_item_custom_attr_categories_ibfk_1` FOREIGN KEY (`fk_i_group_id`) REFERENCES `oc_t_item_custom_attr_groups` (`pk_i_id`))
你知道如何更改 ?謝謝
編輯
oc_t_item_custom_attr_categories
fk_i_group_id int(10) unsigned
fk_i_category_id int(10) unsigned
指標
PRIMARY fk_i_group_id, fk_i_category_id
INDEX fk_i_category_id
foregin鍵
fk_i_group_id oc_t_item_custom_attr_groups_2(pk_i_id) RESTRICT RESTRICT
fk_i_category_id oc_t_category(pk_i_id) RESTRICT RESTRICT
用正確的DBMS標記問題。大多數DBMS在外鍵中支持ON UPDATE CASCADE選項以將PK的更改傳播到引用表。 – Serg