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

--- Comment #14 from Galen Charlton <gmcha...@gmail.com> ---
And a more tested version:

create table tmp_reserves as select * from reserves limit 0;
alter table tmp_reserves add column reservenumber int(11) not null
auto_increment primary key;
insert into tmp_reserves (borrowernumber, reservedate, biblionumber,
constrainttype, branchcode, notificationdate, reminderdate, cancellationdate,
reservenotes, priority, found, timestamp, itemnumber, waitingdate,
expirationdate, lowestPriority) select borrowernumber, reservedate,
biblionumber, constrainttype, branchcode, notificationdate, reminderdate,
cancellationdate, reservenotes, priority, found, timestamp, itemnumber,
waitingdate, expirationdate, lowestPriority from old_reserves order by
reservedate;

set @ai=(select max(reservenumber) from tmp_reserves);

truncate old_reserves;
alter table old_reserves add reservenumber int(11);
insert into old_reserves select * from tmp_reserves where reservenumber <= @ai;

insert into tmp_reserves (borrowernumber, reservedate, biblionumber,
constrainttype, branchcode, notificationdate, reminderdate, cancellationdate,
reservenotes, priority, found, timestamp, itemnumber, waitingdate,
expirationdate, lowestPriority) select borrowernumber, reservedate,
biblionumber, constrainttype, branchcode, notificationdate, reminderdate,
cancellationdate, reservenotes, priority, found, timestamp, itemnumber,
waitingdate, expirationdate, lowestPriority from reserves order by reservedate;

alter table reserves add reservenumber int(11) not null auto_increment
primary_key;
truncate reserves;
insert into reserves select * from tmp_reserves where reservenumber > @ai;
drop table tmp_reserves;

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to