From 88b3ebea6f1d5bff9212727dc1bbaa5478da5208 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Tue, 29 Oct 2024 20:43:44 +0000 Subject: [PATCH] Bug 32773: Add column biblio_framework.is_fast_add --- .../data/mysql/atomicupdate/bug_32773.pl | 26 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 27 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_32773.pl diff --git a/installer/data/mysql/atomicupdate/bug_32773.pl b/installer/data/mysql/atomicupdate/bug_32773.pl new file mode 100755 index 0000000000..c2752ef832 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_32773.pl @@ -0,0 +1,26 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "32773", + description => "Add ability to have more than 1 Fast Add framework", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + try { + $dbh->do(q{ + ALTER TABLE biblio_framework + ADD COLUMN is_fast_add TINYINT(1) NOT NULL DEFAULT 0 + AFTER frameworktext; + }); + say $out "Added column 'biblio_framework.is_fast_add'"; + $dbh->do(q{ + UPDATE biblio_framework SET is_fast_add = 1 where frameworkcode = 'FA'; + }); + } + catch { + say_failure( $out, "Database modification failed with errors: $_" ); + }; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 442f683e02..5b821047a1 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1121,6 +1121,7 @@ DROP TABLE IF EXISTS `biblio_framework`; CREATE TABLE `biblio_framework` ( `frameworkcode` varchar(4) NOT NULL DEFAULT '' COMMENT 'the unique code assigned to the framework', `frameworktext` varchar(255) NOT NULL DEFAULT '' COMMENT 'the description/name given to the framework', + `is_fast_add` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'the ability to be used as a Fast Add framework', PRIMARY KEY (`frameworkcode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- 2.39.5