From 94c5453fb8f76ef1185ec0c85ada90b2169f2990 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 3 Dec 2024 16:50:43 +0000 Subject: [PATCH] Bug 30301: Add a new column to enforce the expiry notice --- ...30301-add_flag_to_enforce_expiry_notice.pl | 23 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 24 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30301-add_flag_to_enforce_expiry_notice.pl diff --git a/installer/data/mysql/atomicupdate/bug_30301-add_flag_to_enforce_expiry_notice.pl b/installer/data/mysql/atomicupdate/bug_30301-add_flag_to_enforce_expiry_notice.pl new file mode 100755 index 00000000000..42fcd222de5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30301-add_flag_to_enforce_expiry_notice.pl @@ -0,0 +1,23 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "30301", + description => "Add a flag to enforce expiry notices", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + unless ( column_exists( 'categories', 'enforce_expiry_notice' ) ) { + $dbh->do( + q{ + ALTER TABLE categories ADD COLUMN `enforce_expiry_notice` tinyint(1) NOT NULL DEFAULT 0 + COMMENT "enforce the patron expiry notice for this category" + AFTER `noissueschargeguarantorswithguarantees` + } + ); + + say_success( $out, "Added column 'enforce_expiry_notice' to categories" ); + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 445d476b704..8abc0262888 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1819,6 +1819,7 @@ CREATE TABLE `categories` ( `noissuescharge` int(11) DEFAULT NULL COMMENT 'define maximum amount outstanding before checkouts are blocked', `noissueschargeguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantees of a patron in this category can have outstanding before checkouts are blocked', `noissueschargeguarantorswithguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantors with guarantees of a patron in this category can have outstanding before checkouts are blocked', + `enforce_expiry_notice` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'enforce the patron expiry notice for this category', PRIMARY KEY (`categorycode`), UNIQUE KEY `categorycode` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- 2.39.3 (Apple Git-146)