mysql - ERROR 1025 (HY000): Error on MODIFY column command -


i need modify primary key column. want change int bigint. there error. how can change it? don't want delete keys..

alter table items modify column itemnumber bigint(12) unsigned not null auto_increment; 

error 1025 (hy000): error on rename of './kohadata/#sql-3ae3_5cf5' './kohadata/items' (errno: 150)

my table;

 create table `items` (   `itemnumber` int(11) not null auto_increment,   `biblionumber` int(11) not null default '0',      primary key (`itemnumber`), ) engine=innodb auto_increment=2147483647 default charset=utf8 collate=utf8_unicode_ci 

complications occur because of auto_increment , primary key attributes. how doing in 2 phases :

  1. remove primary key (alter table items modify column itemnumber bigint(12) unsigned not null, drop primary key;)
  2. add primary key again (alter table items modify column itemnumber bigint(12) unsigned not null auto_increment primary key;)

or have read, might because foreign key constraints. need remove foreign key constraints in other tables refer table, change primary key in items table, change column type in other tables match new column type, , re-add foreign key constraints.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -