Bugzilla – Attachment 31640 Details for
Bug 11577
Automatic renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11577: Add auto_renew flags to the database
Bug-11577-Add-autorenew-flags-to-the-database.patch (text/plain), 3.95 KB, created by
Holger Meißner
on 2014-09-17 06:49:29 UTC
(
hide
)
Description:
Bug 11577: Add auto_renew flags to the database
Filename:
MIME Type:
Creator:
Holger Meißner
Created:
2014-09-17 06:49:29 UTC
Size:
3.95 KB
patch
obsolete
>From 7ddc288049cd399f5ab8426344c3ab0af55dde8d Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Holger=20Mei=C3=9Fner?= <h.meissner.82@web.de> >Date: Thu, 15 May 2014 16:18:36 +0200 >Subject: [PATCH] Bug 11577: Add auto_renew flags to the database >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >- issues.auto_renew >- old_issues.auto_renew >- issuingrules.auto_renew > >Default value is zero. > >To test: > >1) Run installer/data/mysql/updatedatabase.pl >2) Create SQL reports like: > SELECT * FROM issues LIMIT 0,1 >3) Confirm that a column auto_renew was added to each of the three tables. > >Sponsored-by: Hochschule für Gesundheit (hsg), Germany >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/kohastructure.sql | 3 +++ > installer/data/mysql/updatedatabase.pl | 15 +++++++++++++++ > 2 files changed, 18 insertions(+) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 54ac922..aeeba17 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1123,6 +1123,7 @@ CREATE TABLE `issues` ( -- information related to check outs or issues > `lastreneweddate` datetime default NULL, -- date the item was last renewed > `return` varchar(4) default NULL, > `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed >+ `auto_renew` BOOLEAN default FALSE, -- automatic renewal > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched > `issuedate` datetime default NULL, -- date the item was checked out or issued > KEY `issuesborridx` (`borrowernumber`), >@@ -1160,6 +1161,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules > `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed > `renewalperiod` int(4) default NULL, -- renewal period in the unit set in issuingrules.lengthunit > `norenewalbefore` int(4) default NULL, -- no renewal allowed until X days or hours before due date. In the unit set in issuingrules.lengthunit >+ `auto_renew` BOOLEAN default FALSE, -- automatic renewal > `reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed > `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode) > overduefinescap decimal(28,6) default NULL, -- the maximum amount of an overdue fine >@@ -1594,6 +1596,7 @@ CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r > `lastreneweddate` datetime default NULL, -- date the item was last renewed > `return` varchar(4) default NULL, > `renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed >+ `auto_renew` BOOLEAN default FALSE, -- automatic renewal > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched > `issuedate` datetime default NULL, -- date the item was checked out or issued > KEY `old_issuesborridx` (`borrowernumber`), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index bfe5f71..edfcbe9 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8751,6 +8751,21 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.17.00.XXX"; >+if(CheckVersion($DBversion)) { >+ $dbh->do(q{ >+ ALTER TABLE issues ADD auto_renew BOOLEAN default FALSE AFTER renewals >+ }); >+ $dbh->do(q{ >+ ALTER TABLE old_issues ADD auto_renew BOOLEAN default FALSE AFTER renewals >+ }); >+ $dbh->do(q{ >+ ALTER TABLE issuingrules ADD auto_renew BOOLEAN default FALSE AFTER norenewalbefore >+ }); >+ print "Upgrade to $DBversion done (Bug 11577: [ENH] Automatic renewal feature)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.7.10.4
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 11577
:
28425
|
28426
|
28427
|
28428
|
28429
|
28430
|
28431
|
28432
|
28433
|
28434
|
28454
|
28595
|
28596
|
28597
|
28598
|
28599
|
28600
|
28601
|
28602
|
28603
|
28604
|
29393
|
29394
|
29395
|
29396
|
29397
|
29398
|
29399
|
29400
|
29401
|
29402
|
29966
|
29967
|
29968
|
29969
|
29970
|
29971
|
29972
|
29973
|
29974
|
29975
|
30248
|
30249
|
30250
|
30251
|
30252
|
30253
|
30254
|
30255
|
30256
|
30257
|
30258
|
30692
|
30693
|
30694
|
30695
|
30696
|
30697
|
30698
|
30699
|
30700
|
30701
|
30702
|
31076
|
31077
|
31078
|
31079
|
31080
|
31081
|
31082
|
31083
|
31084
|
31085
|
31086
|
31198
|
31199
|
31200
|
31201
|
31202
|
31203
|
31204
|
31205
|
31206
|
31207
|
31208
|
31209
|
31640
|
31641
|
31642
|
31643
|
31644
|
31645
|
31646
|
31647
|
31648
|
31649
|
31650
|
31651
|
31652
|
31653
|
31654
|
31655
|
31656
|
31657
|
31658
|
31659
|
31660
|
31661
|
31662
|
31663
|
57734