Bug 18970

Summary: Yet another try at issue id's
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18966
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 1xxxx: DBIx schema changes for Autoincrement
Bug 1xxxx: Add Koha::Autoincrement[s]
Bug 1xxxx: Use autoincrement in AddIssue

Description Marcel de Rooy 2017-07-21 09:57:42 UTC

    
Comment 1 Marcel de Rooy 2017-07-21 09:58:42 UTC
Created attachment 65162 [details] [review]
Bug 1xxxx: DBIx schema changes for Autoincrement
Comment 2 Marcel de Rooy 2017-07-21 09:58:45 UTC
Created attachment 65163 [details] [review]
Bug 1xxxx: Add Koha::Autoincrement[s]
Comment 3 Marcel de Rooy 2017-07-21 09:58:48 UTC
Created attachment 65164 [details] [review]
Bug 1xxxx: Use autoincrement in AddIssue
Comment 4 Marcel de Rooy 2017-07-21 10:09:13 UTC
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.
Comment 5 Marcel de Rooy 2017-07-21 10:13:28 UTC
create table autoincrement (tablename varchar(255), counter int, primary key (tablename));
Comment 6 Marcel de Rooy 2017-07-21 10:14:22 UTC
Koha::Autoincrement->new({ tablename => 'issues', counter => 0 })->store;