Browse Source

Bug 23916: (follow-up) Adapt all the things to the new column and accessor names

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Jonathan Druart 9 months ago
parent
commit
8dd313fc4a
  1. 4
      C4/Members.pm
  2. 6
      installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl

4
C4/Members.pm

@ -276,7 +276,7 @@ sub GetAllIssues {
'SELECT issues.*, items.*, biblio.*, biblioitems.*, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp,borrowers.firstname,borrowers.surname
FROM issues
LEFT JOIN items on items.itemnumber=issues.itemnumber
LEFT JOIN borrowers on borrowers.borrowernumber=issues.issuer
LEFT JOIN borrowers on borrowers.borrowernumber=issues.issuer_id
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
WHERE issues.borrowernumber=?
@ -284,7 +284,7 @@ sub GetAllIssues {
SELECT old_issues.*, items.*, biblio.*, biblioitems.*, old_issues.timestamp as issuestimestamp, old_issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp,borrowers.firstname,borrowers.surname
FROM old_issues
LEFT JOIN items on items.itemnumber=old_issues.itemnumber
LEFT JOIN borrowers on borrowers.borrowernumber=old_issues.issuer
LEFT JOIN borrowers on borrowers.borrowernumber=old_issues.issuer_id
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
WHERE old_issues.borrowernumber=? AND old_issues.itemnumber IS NOT NULL

6
installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl

@ -1,17 +1,17 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
if( !column_exists( 'issues', 'issuer' ) ) {
if( !column_exists( 'issues', 'issuer_id' ) ) {
$dbh->do( q| ALTER TABLE issues ADD issuer_id INT(11) DEFAULT NULL AFTER borrowernumber | );
}
if (!foreign_key_exists( 'issues', 'issues_ibfk_borrowers_borrowernumber' )) {
$dbh->do( q| ALTER TABLE issues ADD CONSTRAINT `issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE | );
}
if( !column_exists( 'old_issues', 'issuer' ) ) {
if( !column_exists( 'old_issues', 'issuer_id' ) ) {
$dbh->do( q| ALTER TABLE old_issues ADD issuer_id INT(11) DEFAULT NULL AFTER borrowernumber | );
}
if (!foreign_key_exists( 'old_issues', 'old_issues_ibfk_borrowers_borrowernumber' )) {
$dbh->do( q| ALTER TABLE old_issues ADD CONSTRAINT `old_issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE | );
}
NewVersion( $DBversion, 23916, "Add issues.issuer";
NewVersion( $DBversion, 23916, "Add issues.issuer_id";
}
Loading…
Cancel
Save