@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_21066.perl | 9 +++++++++ installer/data/mysql/kohastructure.sql | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_21066.perl --- a/installer/data/mysql/atomicupdate/bug_21066.perl +++ a/installer/data/mysql/atomicupdate/bug_21066.perl @@ -0,0 +1,9 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do(q| + ALTER TABLE opac_news + CHANGE COLUMN timestamp publicationdate date DEFAULT NULL, + ADD COLUMN updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + |); + NewVersion( $DBversion, 21066, "Update table opac_news"); +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -1723,7 +1723,8 @@ CREATE TABLE `opac_news` ( -- data from the news tool `title` varchar(250) NOT NULL default '', -- title of the news article `content` MEDIUMTEXT NOT NULL, -- the body of your news article `lang` varchar(50) NOT NULL default '', -- location for the article (koha is the staff client, slip is the circulation receipt and language codes are for the opac) - `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- pulibcation date and time + `publicationdate` date DEFAULT NULL, -- publication date + `updated_on` timestamp NOT NULL default CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification `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 --