[Koha-bugs] [Bug 13790] Add unique id issue_id to issues and old_issues tables

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 17 16:43:39 CEST 2015


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

M. de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Failed QA

--- Comment #13 from M. de Rooy <m.de.rooy at rijksmuseum.nl> ---
QA Comment:
Being somewhat strict now :) I have some hesitations about your db revision:

It makes Koha::Database appear now in mysql/updatedatabase.pl. Well, it must be
introduced one day. That is true, but maybe it needs a little bit more thought?
The DBIx project is not moving so much these days..
The $schema should not be in a far-away if statement btw.

Secondly, you combine the old way with $dbh from C4 with some DBIx statements.
That does not look good to me.

And what about these lines:
+    my $max_issue_id =
$schema->resultset('Issue')->get_column('issue_id')->max();
+    $max_issue_id ||=
$schema->resultset('OldIssue')->get_column('issue_id')->max();
+    $max_issue_id ||= 0;
+    $max_issue_id++;
+    $dbh->do(qq{
+        ALTER TABLE issues AUTO_INCREMENT = $max_issue_id}
That is somewhat strange. It will work, but you should just pick max from
issues. If there are no records, you are ready. Otherwise +1.

All by all, I recommend adjusting your patch.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list