From a5492f3ddfc2b434085297e9d21d959901d70c07 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Wed, 14 Sep 2022 14:51:51 +0300 Subject: [PATCH] Bug 16223: Add new columns to table restriction_types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds two new columns, lift_after_payment and fee_limit, to table restriction_types. These colums are used to control lifting patrons restrictions after paying their fees. To test: 1. Apply this patch. 2. Update your database via updatedatabase.pl. => Confirm your table restriction_types has two new columns. Sponsored-by: Koha-Suomi Oy Signed-off-by: Anneli Österman --- .../data/mysql/atomicupdate/bug_16223.pl | 24 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 26 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_16223.pl diff --git a/installer/data/mysql/atomicupdate/bug_16223.pl b/installer/data/mysql/atomicupdate/bug_16223.pl new file mode 100755 index 0000000000..12aa40823a --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_16223.pl @@ -0,0 +1,24 @@ +use Modern::Perl; + +return { + bug_number => "16223", + description => "Add new columns lift_after_payment and fee_limit to table restriction_types", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + if( !column_exists( 'restriction_types', 'lift_after_payment' ) ) { + $dbh->do(q{ + ALTER TABLE restriction_types ADD COLUMN `lift_after_payment` tinyint(1) NOT NULL DEFAULT 0 + }); + } + say $out "Added column lift_after_payment"; + + if( !column_exists( 'restriction_types', 'fee_limit' ) ) { + $dbh->do(q{ + ALTER TABLE restriction_types ADD COLUMN `fee_limit` decimal(28,6) DEFAULT NULL + }); + } + say $out "Added column fee_limit"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 54ed708304..4570317e92 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2139,6 +2139,8 @@ CREATE TABLE `restriction_types` ( `display_text` text NOT NULL, `is_system` tinyint(1) NOT NULL DEFAULT 0, `is_default` tinyint(1) NOT NULL DEFAULT 0, + `lift_after_payment` tinyint(1) NOT NULL DEFAULT 0, + `fee_limit` decimal(28,6) DEFAULT NULL PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.30.2