@@ -, +, @@ in accordance with wiki guidelines. 'Administration' -> 'Tools' -> 'News'. mysql -u kohaadmin -p -D koha (change username and database to values appropiate for your system). created before the patch was applied, and non-NULL for the new item created AFTER the patch was applied. ALTER TABLE opac_news DROP FOREIGN KEY borrowernumber_fk; ALTER TABLE opac_news DROP COLUMN borrowernumber; --- installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql | 2 ++ installer/data/mysql/kohastructure.sql | 2 ++ tools/koha-news.pl | 1 + 3 files changed, 5 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql --- a/installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql +++ a/installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql @@ -0,0 +1,2 @@ +ALTER TABLE `opac_news` ADD `borrowernumber` INT(11) default NULL; +ALTER TABLE `opac_news` ADD CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers`(`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL; --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -1685,7 +1685,9 @@ CREATE TABLE `opac_news` ( -- data from the news tool `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- pulibcation date and time `expirationdate` date default NULL, -- date the article is set to expire or no longer be visible `number` int(11) default NULL, -- the order in which this article appears in that specific location + `borrowernumber` int(11) default NULL, -- The user who created the news article PRIMARY KEY (`idnew`), + CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --- 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"); --