以下是我当前的数据库结构
CREATE TABLE one (
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id));
CREATE TABLE two (
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
one_id MEDIUMINT UNSIGNED NOT NULL
PRIMARY KEY (id),
CONSTRAINT FOREIGN KEY (`one_Id`) REFERENCES `one` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);
如何在两个表上运行以下 alter 命令
ALTER TABLE one MODIFY COLUMN `id` int(10) NOT NULL auto_increment;
ALTER TABLE two MODIFY COLUMN `one_id` int(10) NOT NULL;
现在我收到这个错误
ERROR 1025 (HY000): Error on rename (errno: 150)
我也尝试禁用这些,但它没有帮助
SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;