[Koha-bugs] [Bug 7065] reserves table needs a primary key

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu May 3 11:07:40 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7065

--- Comment #11 from MJ Ray (software.coop) <mjr at software.coop> ---
Would this be safer as an updatedatabase approach:

alter table reserves add column reservenumber int(11) not null auto_increment
primary key;
set @ai=(select max(reservenumber) from reserves);
alter table old_reserves add reservenumber int(11);
insert into reserves select * from old_reserves;
truncate old_reserves;
insert into old_reserves select * from reserves where reservenumber > @ai;
delete from reserves where reservenumber > @ai;
alter table old_reserves add primary key reservenumber;

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list