0
請看這段代碼,我正在使用mysql。MySql表現不佳
create table `dictionary_one` (`dict_id` int(10) primary key)
engine = innodb;
create table `already_exists`(
`pk_id` int(10) primary key,
`ref_dict_one_id` int(10),
constraint `Already_exists_ibfk_1` foreign key(`ref_dict_one_id`) references `dictionary_one`(`dict_id`)
);
看來目前一切進展順利。現在 - 添加另一個引用另一個表的列。
create table `dictionary_two` (`dict_id` int(10) primary key)
engine = innodb;
alter table `already_exists` add column `ref_dict_two_id` int(10), add foreign key `Already_exists_ibfk_2`(`ref_dict_two_id`) references `dictionary_two`(`dict_id`);
沒有語法錯誤,一切都做對,而是:
ERROR 1050 (42S01): Table './test/already_exists' already exists
1 row in set (0.00 sec)
,我的問題是...爲什麼?