View | Details | Raw Unified | Return to bug 21066
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/opac_news.perl (+15 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( q|
4
ALTER TABLE opac_news ADD COLUMN (publisheddate DATE NOT NULL)
5
    |);
6
    $dbh->do( q|
7
UPDATE opac_news SET publisheddate = CAST(timestamp AS DATE)
8
    |);
9
    $dbh->do( q|
10
ALTER TABLE opac_news DROP COLUMN timestamp, ADD COLUMN (updated_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)
11
    |);
12
13
    SetVersion( $DBversion );
14
    print "Upgrade to $DBversion done (opac_news: updated_on)\n";
15
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 1836-1845 CREATE TABLE `opac_news` ( -- data from the news tool Link Here
1836
  `title` varchar(250) NOT NULL default '', -- title of the news article
1836
  `title` varchar(250) NOT NULL default '', -- title of the news article
1837
  `new` text NOT NULL, -- the body of your news article
1837
  `new` text NOT NULL, -- the body of your news article
1838
  `lang` varchar(25) NOT NULL default '', -- location for the article (koha is the staff client, slip is the circulation receipt and language codes are for the opac)
1838
  `lang` varchar(25) NOT NULL default '', -- location for the article (koha is the staff client, slip is the circulation receipt and language codes are for the opac)
1839
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- pulibcation date and time
1839
  `publisheddate` date NOT NULL, -- pulibcation date
1840
  `expirationdate` date default NULL, -- date the article is set to expire or no longer be visible
1840
  `expirationdate` date default NULL, -- date the article is set to expire or no longer be visible
1841
  `number` int(11) default NULL, -- the order in which this article appears in that specific location
1841
  `number` int(11) default NULL, -- the order in which this article appears in that specific location
1842
  `borrowernumber` int(11) default NULL, -- The user who created the news article
1842
  `borrowernumber` int(11) default NULL, -- The user who created the news article
1843
  `updated_on` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
1843
  PRIMARY KEY  (`idnew`),
1844
  PRIMARY KEY  (`idnew`),
1844
  CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
1845
  CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
1845
  CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode)
1846
  CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode)
1846
- 

Return to bug 21066