Bug 18970 - Yet another try at issue id's
Summary: Yet another try at issue id's
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-21 09:57 UTC by Marcel de Rooy
Modified: 2017-07-27 06:43 UTC (History)
0 users

See Also:
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 (1.74 KB, patch)
2017-07-21 09:58 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 1xxxx: Add Koha::Autoincrement[s] (3.25 KB, patch)
2017-07-21 09:58 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 1xxxx: Use autoincrement in AddIssue (1.72 KB, patch)
2017-07-21 09:58 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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;