From 46b7d5e4c66d5eff732187dd25c5d3bc79305c8b Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 8 Jul 2016 13:36:32 +0000 Subject: [PATCH] Bug 6906 - DBRev 16.06.00.008 Signed-off-by: Kyle M Hall --- Koha.pm | 2 +- Koha/Schema/Result/Borrower.pm | 18 +++++++++++-- Koha/Schema/Result/Category.pm | 18 +++++++++++-- Koha/Schema/Result/Deletedborrower.pm | 18 +++++++++++-- .../mysql/atomicupdate/checkPrevCheckout.sql | 14 ---------- installer/data/mysql/updatedatabase.pl | 26 +++++++++++++++++++ 6 files changed, 75 insertions(+), 21 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/checkPrevCheckout.sql diff --git a/Koha.pm b/Koha.pm index 240f7e08d3..0533eb4c35 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "16.06.00.007"; +$VERSION = "16.06.00.008"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index cfbce27913..ecf39e996a 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -407,6 +407,13 @@ __PACKAGE__->table("borrowers"); default_value: 0 is_nullable: 0 +=head2 checkprevcheckout + + data_type: 'varchar' + default_value: 'inherit' + is_nullable: 0 + size: 7 + =head2 updated_on data_type: 'timestamp' @@ -583,6 +590,13 @@ __PACKAGE__->add_columns( { data_type => "integer", default_value => 1, is_nullable => 0 }, "privacy_guarantor_checkouts", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "checkprevcheckout", + { + data_type => "varchar", + default_value => "inherit", + is_nullable => 0, + size => 7, + }, "updated_on", { data_type => "timestamp", @@ -1218,8 +1232,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-06-14 16:35:12 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Luq1YVrOwtdDvSDWgWNGUg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-08 13:37:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GiEcKBFRhzHwXPekj6fSPg __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm index 49265879a4..fc26a7d496 100644 --- a/Koha/Schema/Result/Category.pm +++ b/Koha/Schema/Result/Category.pm @@ -116,6 +116,13 @@ __PACKAGE__->table("categories"); extra: {list => ["default","never","forever"]} is_nullable: 0 +=head2 checkprevcheckout + + data_type: 'varchar' + default_value: 'inherit' + is_nullable: 0 + size: 7 + =cut __PACKAGE__->add_columns( @@ -161,6 +168,13 @@ __PACKAGE__->add_columns( extra => { list => ["default", "never", "forever"] }, is_nullable => 0, }, + "checkprevcheckout", + { + data_type => "varchar", + default_value => "inherit", + is_nullable => 0, + size => 7, + }, ); =head1 PRIMARY KEY @@ -253,8 +267,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-18 13:01:05 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:T4i7vp1kAZFXy6DiV1dqyw +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-08 13:37:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LH3DdDDYXaGsNsILAUZzng # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Deletedborrower.pm b/Koha/Schema/Result/Deletedborrower.pm index 2558babc3b..4223d5b7e0 100644 --- a/Koha/Schema/Result/Deletedborrower.pm +++ b/Koha/Schema/Result/Deletedborrower.pm @@ -404,6 +404,13 @@ __PACKAGE__->table("deletedborrowers"); default_value: 0 is_nullable: 0 +=head2 checkprevcheckout + + data_type: 'varchar' + default_value: 'inherit' + is_nullable: 0 + size: 7 + =head2 updated_on data_type: 'timestamp' @@ -568,6 +575,13 @@ __PACKAGE__->add_columns( { data_type => "integer", default_value => 1, is_nullable => 0 }, "privacy_guarantor_checkouts", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "checkprevcheckout", + { + data_type => "varchar", + default_value => "inherit", + is_nullable => 0, + size => 7, + }, "updated_on", { data_type => "timestamp", @@ -578,8 +592,8 @@ __PACKAGE__->add_columns( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-06-14 16:35:12 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wmWyqDcbofgVoIbvRy7j6w +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-07-08 13:37:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Cunir7NU2+WyAmwi3U7mvA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/installer/data/mysql/atomicupdate/checkPrevCheckout.sql b/installer/data/mysql/atomicupdate/checkPrevCheckout.sql deleted file mode 100644 index 2e6fd7eebe..0000000000 --- a/installer/data/mysql/atomicupdate/checkPrevCheckout.sql +++ /dev/null @@ -1,14 +0,0 @@ -INSERT INTO systempreferences (variable,value,options,explanation,type) -VALUES('CheckPrevCheckout','hardno','hardyes|softyes|softno|hardno','By default, for every item checked out, should we warn if the patron has checked out that item in the past?','Choice'); - -ALTER TABLE categories -ADD COLUMN `checkprevcheckout` varchar(7) NOT NULL default 'inherit' -AFTER `default_privacy`; - -ALTER TABLE borrowers -ADD COLUMN `checkprevcheckout` varchar(7) NOT NULL default 'inherit' -AFTER `privacy_guarantor_checkouts`; - -ALTER TABLE deletedborrowers -ADD COLUMN `checkprevcheckout` varchar(7) NOT NULL default 'inherit' -AFTER `privacy_guarantor_checkouts`; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 43ba8ab9e8..dd4ebdfc57 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -12726,6 +12726,32 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = '16.06.00.008'; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + INSERT INTO systempreferences (variable,value,options,explanation,type) + VALUES('CheckPrevCheckout','hardno','hardyes|softyes|softno|hardno','By default, for every item checked out, should we warn if the patron has checked out that item in the past?','Choice'); + }); + $dbh->do(q{ + ALTER TABLE categories + ADD COLUMN `checkprevcheckout` varchar(7) NOT NULL default 'inherit' + AFTER `default_privacy`; + }); + $dbh->do(q{ + ALTER TABLE borrowers + ADD COLUMN `checkprevcheckout` varchar(7) NOT NULL default 'inherit' + AFTER `privacy_guarantor_checkouts`; + }); + $dbh->do(q{ + ALTER TABLE deletedborrowers + ADD COLUMN `checkprevcheckout` varchar(7) NOT NULL default 'inherit' + AFTER `privacy_guarantor_checkouts`; + }); + + print "Upgrade to $DBversion done (Bug 6906 - show 'Borrower has previously issued $ITEM' alert on checkout)\n"; + SetVersion($DBversion); +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 -- 2.39.5