Bugzilla – Attachment 50478 Details for
Bug 10459
borrowers should have a timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 10459: Borrowers should have a timestamp
SIGNED-OFF-Bug-10459-Borrowers-should-have-a-times.patch (text/plain), 3.92 KB, created by
Bernardo Gonzalez Kriegel
on 2016-04-20 19:39:15 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 10459: Borrowers should have a timestamp
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2016-04-20 19:39:15 UTC
Size:
3.92 KB
patch
obsolete
>From 17768e3a9ac3ff355d8f8c148814b30715ebfd8a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 10 Nov 2014 14:17:40 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 10459: Borrowers should have a timestamp > >This patch adds a timestamp column to the borrowers table in kohastructure >and updatedatabase. (And also to the deletedborrowers table.) >A timestamp may be useful in synchronizing with external systems (among other >reasons). > >Test plan: >Run updatestructure on an existing database, or install a new one. >Verify that the borrowers table has a timestamp now. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested updatestructure and running kohastructure.sql. >Passed t/db_dependent/Members.t. > >updatedatabase.pl did not apply. I edited and then run it. Columns were added as expected. >Signed-off-by: Marc Veron <veron@veron.ch> > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ > 2 files changed, 16 insertions(+) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e6e3142..3f86fc9 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -266,6 +266,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons > `sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber > `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history > `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts >+ `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) > UNIQUE KEY `cardnumber` (`cardnumber`), > PRIMARY KEY `borrowernumber` (`borrowernumber`), > KEY `categorycode` (`categorycode`), >@@ -918,6 +919,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower > `sms_provider_id` int(11) DEFAULT NULL, -- the provider of the mobile phone number defined in smsalertnumber > `privacy` integer(11) DEFAULT '1' NOT NULL, -- patron/borrower's privacy settings related to their reading history KEY `borrowernumber` (`borrowernumber`), > `privacy_guarantor_checkouts` tinyint(1) NOT NULL DEFAULT '0', -- controls if relatives can see this patron's checkouts >+ `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) > KEY borrowernumber (borrowernumber), > KEY `cardnumber` (`cardnumber`), > KEY `sms_provider_id` (`sms_provider_id`) >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 422ce69..4ed2d11 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -12219,6 +12219,20 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > print "Upgrade to $DBversion done (Bug 15008 - Add custom HTML areas to circulation and reports home pages)\n"; > SetVersion($DBversion); > } >+ >+$DBversion = "3.23.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q| >+ALTER TABLE borrowers ADD COLUMN timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER privacy; >+ |); >+ $dbh->do(q| >+ALTER TABLE deletedborrowers ADD COLUMN timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER privacy; >+ |); >+ print "Upgrade to $DBversion done (Bug 10459: Borrowers should have a timestamp)\n"; >+ SetVersion($DBversion); >+} >+ >+ > # DEVELOPER PROCESS, search for anything to execute in the db_update directory > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. >-- >1.9.1
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 10459
:
33421
|
33424
|
33435
|
33490
|
33491
|
33509
|
50475
|
50476
|
50478
|
50479
|
50480
|
50481
|
51807
|
51808
|
51809
|
51810
|
51842
|
51843
|
51844
|
51867
|
51868
|
52113
|
52114
|
52115
|
52294