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

(-)a/installer/data/mysql/kohastructure.sql (-1 / +4 lines)
Lines 1642-1654 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1642
DROP TABLE IF EXISTS `opac_news`;
1642
DROP TABLE IF EXISTS `opac_news`;
1643
CREATE TABLE `opac_news` ( -- data from the news tool
1643
CREATE TABLE `opac_news` ( -- data from the news tool
1644
  `idnew` int(10) unsigned NOT NULL auto_increment, -- unique identifier for the news article
1644
  `idnew` int(10) unsigned NOT NULL auto_increment, -- unique identifier for the news article
1645
  `branchcode` varchar(10) default NULL, -- branch code users to create branch specific news, NULL is every branch.
1645
  `title` varchar(250) NOT NULL default '', -- title of the news article
1646
  `title` varchar(250) NOT NULL default '', -- title of the news article
1646
  `new` text NOT NULL, -- the body of your news article
1647
  `new` text NOT NULL, -- the body of your news article
1647
  `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)
1648
  `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)
1648
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- pulibcation date and time
1649
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- pulibcation date and time
1649
  `expirationdate` date default NULL, -- date the article is set to expire or no longer be visible
1650
  `expirationdate` date default NULL, -- date the article is set to expire or no longer be visible
1650
  `number` int(11) default NULL, -- the order in which this article appears in that specific location
1651
  `number` int(11) default NULL, -- the order in which this article appears in that specific location
1651
  PRIMARY KEY  (`idnew`)
1652
  PRIMARY KEY  (`idnew`),
1653
  CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode)
1654
    ON DELETE CASCADE ON UPDATE CASCADE
1652
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1655
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1653
1656
1654
--
1657
--
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +15 lines)
Lines 7953-7958 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
7953
    SetVersion($DBversion);
7953
    SetVersion($DBversion);
7954
}
7954
}
7955
7955
7956
$DBversion = "3.15.00.XXX";
7957
if (CheckVersion($DBversion)) {
7958
    $dbh->do(q{
7959
        ALTER TABLE opac_news ADD branchcode varchar(10) DEFAULT NULL
7960
                                  AFTER idnew,
7961
                              ADD CONSTRAINT opac_news_branchcode_ibfk
7962
                                  FOREIGN KEY (branchcode)
7963
                                  REFERENCES branches (branchcode)
7964
                                  ON DELETE CASCADE ON UPDATE CASCADE;
7965
    });
7966
    print "Upgrade to $DBversion done (Bug 7567: Add branchcode to opac_news)\n";
7967
    SetVersion($DBversion);
7968
}
7969
7970
7956
=head1 FUNCTIONS
7971
=head1 FUNCTIONS
7957
7972
7958
=head2 TableExists($table)
7973
=head2 TableExists($table)
7959
- 

Return to bug 7567