先增加一个字段,然后删除以前表的主键,然后重新定义复合主键
1.alter table your_table add column your_column int(3) not null default 0
2.alter table your_table drop primary key
3.alter table your_table add primary key(c1,c2,your_column)
先增加一个字段,然后删除以前表的主键,然后重新定义复合主键
1.alter table your_table add column your_column int(3) not null default 0
2.alter table your_table drop primary key
3.alter table your_table add primary key(c1,c2,your_column)
转载于:https://my.oschina.net/u/1417838/blog/910139