Bugzilla – Attachment 26598 Details for
Bug 7567
News by Library: refactor, enhance, and fix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7567 - Added branchcode to opac_news
Bug-7567---Added-branchcode-to-opacnews.patch (text/plain), 3.62 KB, created by
Mark Tompsett
on 2014-03-26 15:58:04 UTC
(
hide
)
Description:
Bug 7567 - Added branchcode to opac_news
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2014-03-26 15:58:04 UTC
Size:
3.62 KB
patch
obsolete
>From cc6c57d63bb1c949c8deecbd48c1555268c28836 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 19 Dec 2013 17:51:34 -0500 >Subject: [PATCH] Bug 7567 - Added branchcode to opac_news > >This patch merely adds branchcode varchar(10) DEFAULT NULL to >the opac_news table. > >TEST PLAN >--------- > 1) backup your kohadata base if you care about the data. > 2) use the koha database > 3) describe opac_news; > 4) show create table opac_news; > -- No branchcode constraint will exist. > 5) apply the patch > 6) upgrade the database (either staff client or script) > 7) use the koha database > 8) describe opac_news; > 9) show create table opac_news; > -- The branchcode constraint should be listed. >10) drop that koha database >11) create the koha database >12) use the koha database >13) source ~/kohaclone/installer/data/mysql/kohastructure.sql > -- there should be no errors in creating the database. >14) describe opac_news; >15) show create table opac_news; > -- The branchcode constraint should be listed. >16) restore your koha database if you backed it up. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > installer/data/mysql/kohastructure.sql | 5 ++++- > installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ > 2 files changed, 19 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 3cf9c65..5facb65 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1642,13 +1642,16 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b > DROP TABLE IF EXISTS `opac_news`; > CREATE TABLE `opac_news` ( -- data from the news tool > `idnew` int(10) unsigned NOT NULL auto_increment, -- unique identifier for the news article >+ `branchcode` varchar(10) default NULL, -- branch code users to create branch specific news, NULL is every branch. > `title` varchar(250) NOT NULL default '', -- title of the news article > `new` text NOT NULL, -- the body of your news article > `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) > `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 >- PRIMARY KEY (`idnew`) >+ PRIMARY KEY (`idnew`), >+ CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode) >+ ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > -- >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 062ecc1..5e7bc27 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8083,6 +8083,21 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if (CheckVersion($DBversion)) { >+ $dbh->do(q{ >+ ALTER TABLE opac_news ADD branchcode varchar(10) DEFAULT NULL >+ AFTER idnew, >+ ADD CONSTRAINT opac_news_branchcode_ibfk >+ FOREIGN KEY (branchcode) >+ REFERENCES branches (branchcode) >+ ON DELETE CASCADE ON UPDATE CASCADE; >+ }); >+ print "Upgrade to $DBversion done (Bug 7567: Add branchcode to opac_news)\n"; >+ SetVersion($DBversion); >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7567
:
22863
|
22917
|
22920
|
23350
|
23351
|
23352
|
23362
|
23368
|
23378
|
23383
|
23386
|
23474
|
23475
|
23501
|
23544
|
23547
|
23552
|
23553
|
23554
|
23559
|
23664
|
23703
|
23704
|
23705
|
25316
|
25317
|
25318
|
25319
|
25320
|
25321
|
25322
|
25323
|
25324
|
25325
|
25331
|
25332
|
25333
|
26510
|
26511
|
26590
|
26591
|
26592
|
26593
|
26594
|
26595
|
26596
|
26597
|
26598
|
26599
|
26600
|
26601
|
26602
|
26603
|
26604
|
26605
|
26606
|
26607
|
26608
|
26609
|
26610
|
26611
|
26612
|
26631
|
26632
|
26633
|
26634
|
26635
|
26636
|
26637
|
26638
|
26639
|
26640
|
26641
|
26642
|
26643
|
26644
|
26647