From 83768738898d13d155f30f28b6c312fba2cbfbb2 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 24 Feb 2017 09:22:26 -0300 Subject: [PATCH] Bug 16034: (followup) Fix DB update and schema files Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Borrower.pm | 9 +++++++-- Koha/Schema/Result/Deletedborrower.pm | 11 +++++++++-- installer/data/mysql/kohastructure.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 4 ++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 4241dd0bfa..547028f592 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -427,6 +427,11 @@ __PACKAGE__->table("borrowers"); datetime_undef_if_invalid: 1 is_nullable: 1 +=head2 overdrive_auth_token + + data_type: 'text' + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -1336,8 +1341,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-31 10:39:35 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Lc6GQ2E7d+tyzTk3v2sWjQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-02-10 07:30:06 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:35WEsGd5LmkZ3bB486M1yA __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/Deletedborrower.pm b/Koha/Schema/Result/Deletedborrower.pm index 937a4a4e9a..778705e997 100644 --- a/Koha/Schema/Result/Deletedborrower.pm +++ b/Koha/Schema/Result/Deletedborrower.pm @@ -424,6 +424,11 @@ __PACKAGE__->table("deletedborrowers"); datetime_undef_if_invalid: 1 is_nullable: 1 +=head2 overdrive_auth_token + + data_type: 'text' + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -601,11 +606,13 @@ __PACKAGE__->add_columns( datetime_undef_if_invalid => 1, is_nullable => 1, }, + "overdrive_auth_token", + { data_type => "text", is_nullable => 1 }, ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-09-13 17:32:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pcdyzQacTbFDJ9R1k0E8mA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-02-10 07:30:06 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tq4JDUSFKuU5K69TTVSkVg # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 117c14f9ba..985ee27626 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -630,6 +630,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface) + `overdrive_auth_token` text default NULL, -- persist OverDrive auth token KEY borrowernumber (borrowernumber), KEY `cardnumber` (`cardnumber`), KEY `sms_provider_id` (`sms_provider_id`) @@ -1655,7 +1656,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface) - overdrive_auth_token text default NULL, -- persist OverDrive auth token + `overdrive_auth_token` text default NULL, -- persist OverDrive auth token UNIQUE KEY `cardnumber` (`cardnumber`), PRIMARY KEY `borrowernumber` (`borrowernumber`), KEY `categorycode` (`categorycode`), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2d94ecd862..336797270f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -13914,6 +13914,10 @@ if( CheckVersion( $DBversion ) ) { }); $dbh->do(q{ + ALTER TABLE deletedborrowers ADD overdrive_auth_token text default NULL AFTER lastseen; + }); + + $dbh->do(q{ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('OverDriveCirculation','0','Enable client to see their OverDrive account','','YesNo'); }); -- 2.11.1