Bug 14246: Add borrowernumber to koha_news
authorMartin Persson <xarragon@gmail.com>
Tue, 26 May 2015 11:23:34 +0000 (13:23 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 27 Oct 2015 18:56:24 +0000 (15:56 -0300)
commit34818c05d561d0caf02f432129c455bf20e1e69d
tree16fbcfc33e72b9041de4215398458cce2ccff47c
parent7bde40a2d5de2db4213f57716ea852be167fe89a
Bug 14246: Add borrowernumber to koha_news

This patch adds a new column to koha_news that links a
borrowernumber to each item. This allows Koha to display the
author for each entry which makes it suitable as a simple CMS.

Changes (from rejected patch):
* Added missing kohastructure.sql changes.
* Turned the atomic update file into a SQL file and changed name
  in accordance with wiki guidelines.
* Changed SQL syntax and naming to be consistent with existing code.
* Attached test plan to commit message.

Test plan:

* You need at least one news item, log in and add one from
  'Administration' -> 'Tools' -> 'News'.
* Apply the patch.
* Apply database upgrade (directly or indirectly).
* Go back to Staff interface and post a new news item.
* Use the mysql command line client to connect to the Koha installation's database:
  mysql -u kohaadmin -p -D koha (change username and database to values
  appropiate for your system).
* Execute the following query: SELECT title, borrowernumber FROM opac_news;
* Inspect the results, the 'borrowernumber' column should be NULL for all news items
  created before the patch was applied, and non-NULL for the new item created AFTER
  the patch was applied.

Optional: Remove database changes via:
  ALTER TABLE opac_news DROP FOREIGN KEY borrowernumber_fk;
  ALTER TABLE opac_news DROP COLUMN borrowernumber;

Sponsored-By: Halland County Library
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
tools/koha-news.pl