Created attachment 65162 [details] [review] Bug 1xxxx: DBIx schema changes for Autoincrement
Created attachment 65163 [details] [review] Bug 1xxxx: Add Koha::Autoincrement[s]
Created attachment 65164 [details] [review] Bug 1xxxx: Use autoincrement in AddIssue
Tested with interface and Circulation.t. And by calling increment thousands of times with parallel processes. Saw Circulation.t fail one time on line 1325. Unrelated and random? This is just unpolished. We should add a dbrev too creating the table and adding an entry for issues. Why keep id's in an additional table? It would be a temporary measure until we merge issues and old_issues on the longer term. We cannot trust InnoDB with autoincrements shared between multiple tables. Saw some references to getting your own autoincrement too. This approach should go with reverting the renumber fix.
create table autoincrement (tablename varchar(255), counter int, primary key (tablename));
Koha::Autoincrement->new({ tablename => 'issues', counter => 0 })->store;