@@ -, +, @@ --- installer/data/mysql/atomicupdate/add_news_author.pl | 12 ++++++++++++ tools/koha-news.pl | 1 + 2 files changed, 13 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/add_news_author.pl --- a/installer/data/mysql/atomicupdate/add_news_author.pl +++ a/installer/data/mysql/atomicupdate/add_news_author.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use C4::Context; + +my $dbh = C4::Context->dbh; +$dbh->do("ALTER TABLE opac_news ADD borrowernumber INT(11) NULL DEFAULT NULL;"); +$dbh->do("ALTER TABLE opac_news ADD CONSTRAINT fk_borrowernumber FOREIGN KEY (borrowernumber) REFERENCES borrowers(borrowernumber) ON DELETE SET NULL ON UPDATE SET NULL;"); + +print "Upgrade done (Adding borrowernumber column and foreign key to opac_news)\n"; --- a/tools/koha-news.pl +++ a/tools/koha-news.pl @@ -114,6 +114,7 @@ elsif ( $op eq 'add' ) { timestamp => $timestamp, number => $number, branchcode => $branchcode, + borrowernumber => $borrowernumber, } ); print $cgi->redirect("/cgi-bin/koha/tools/koha-news.pl"); --