From 73afc7ed63731ff2ed67b4d11d4e350f5d0a213b Mon Sep 17 00:00:00 2001
From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Date: Tue, 7 Sep 2021 09:33:44 +0300
Subject: [PATCH 1/3] Bug 9525: Add ft_local_float_group column

This patch adds new ft_local_float_group column
to library_groups table.

To test:
1. Apply patch and update database
2. Confirm new column is added correctly to the
library_groups table

Sponsored-by: Koha-Suomi Oy
---
 .../Bug-9525-Add_ft_local_float_group_column.perl      | 10 ++++++++++
 installer/data/mysql/kohastructure.sql                 |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 installer/data/mysql/atomicupdate/Bug-9525-Add_ft_local_float_group_column.perl

diff --git a/installer/data/mysql/atomicupdate/Bug-9525-Add_ft_local_float_group_column.perl b/installer/data/mysql/atomicupdate/Bug-9525-Add_ft_local_float_group_column.perl
new file mode 100644
index 0000000000..c661b463da
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/Bug-9525-Add_ft_local_float_group_column.perl
@@ -0,0 +1,10 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    # you can use $dbh here like:
+    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
+
+    $dbh->do("ALTER TABLE library_groups ADD COLUMN ft_local_float_group tinyint(1) NOT NULL DEFAULT 0 AFTER ft_local_hold_group");
+
+    # Always end with this (adjust the bug info)
+    NewVersion( $DBversion, 9525, "Add option to set group as local float group");
+}
diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index 02cf864ddd..2181216990 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -3291,6 +3291,7 @@ CREATE TABLE `library_groups` (
   `ft_search_groups_opac` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Use this group for staff side search groups',
   `ft_search_groups_staff` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Use this group for opac side search groups',
   `ft_local_hold_group` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Use this group to identify libraries as pick up location for holds',
+  `ft_local_float_group` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Use this group to identify libraries as part of float group',
   `created_on` timestamp NULL DEFAULT NULL COMMENT 'Date and time of creation',
   `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Date and time of last',
   PRIMARY KEY (`id`),
-- 
2.25.1