diff --git a/installer/data/mysql/atomicupdate/bug_42447.pl b/installer/data/mysql/atomicupdate/bug_42447.pl new file mode 100755 index 0000000000..f5b4d43042 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_42447.pl @@ -0,0 +1,37 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "42447", + description => "Convert SIP template fields to TEXT", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + ALTER TABLE `sip_accounts` + MODIFY COLUMN `ae_field_template` TEXT DEFAULT NULL, + MODIFY COLUMN `av_field_template` TEXT DEFAULT NULL, + MODIFY COLUMN `da_field_template` TEXT DEFAULT NULL + } + ); + say_success( $out, "Converted sip_accounts template columns to TEXT" ); + + $dbh->do( + q{ + ALTER TABLE `sip_account_custom_item_fields` + MODIFY COLUMN `template` TEXT NOT NULL COMMENT 'Template toolkit template' + } + ); + say_success( $out, "Converted sip_account_custom_item_fields.template to TEXT" ); + + $dbh->do( + q{ + ALTER TABLE `sip_account_custom_patron_fields` + MODIFY COLUMN `template` TEXT NOT NULL COMMENT 'Template toolkit template' + } + ); + say_success( $out, "Converted sip_account_custom_patron_fields.template to TEXT" ); + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index b338a34ff0..5860dfcf0a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -6061,7 +6061,7 @@ CREATE TABLE `sip_account_custom_item_fields` ( `sip_account_custom_item_field_id` int(11) NOT NULL AUTO_INCREMENT, `sip_account_id` int(11) NOT NULL COMMENT 'Foreign key to sip_accounts.sip_account_id', `field` varchar(80) NOT NULL COMMENT 'SIP field name e.g. XY', - `template` varchar(255) NOT NULL COMMENT 'Template toolkit template name', + `template` text NOT NULL COMMENT 'Template toolkit template', PRIMARY KEY (`sip_account_custom_item_field_id`), UNIQUE KEY `sip_account` (`sip_account_custom_item_field_id`,`sip_account_id`), KEY `sip_account_custom_item_fields_ibfk_1` (`sip_account_id`), @@ -6080,7 +6080,7 @@ CREATE TABLE `sip_account_custom_patron_fields` ( `sip_account_custom_patron_field_id` int(11) NOT NULL AUTO_INCREMENT, `sip_account_id` int(11) NOT NULL COMMENT 'Foreign key to sip_accounts.sip_account_id', `field` varchar(80) NOT NULL COMMENT 'SIP field name e.g. XY', - `template` varchar(80) NOT NULL COMMENT 'Template toolkit template', + `template` text NOT NULL COMMENT 'Template toolkit template', PRIMARY KEY (`sip_account_custom_patron_field_id`), UNIQUE KEY `sip_account` (`sip_account_custom_patron_field_id`,`sip_account_id`), KEY `sip_account_custom_patron_fields_ibfk_1` (`sip_account_id`), @@ -6192,11 +6192,11 @@ DROP TABLE IF EXISTS `sip_accounts`; CREATE TABLE `sip_accounts` ( `sip_account_id` int(11) NOT NULL AUTO_INCREMENT, `sip_institution_id` int(11) NOT NULL COMMENT 'Foreign key to sip_institutions.sip_institution_id', - `ae_field_template` varchar(255) DEFAULT NULL, + `ae_field_template` text DEFAULT NULL, `allow_additional_materials_checkout` tinyint(1) DEFAULT NULL, `allow_empty_passwords` tinyint(1) DEFAULT NULL, `allow_fields` varchar(255) DEFAULT NULL, - `av_field_template` varchar(255) DEFAULT NULL, + `av_field_template` text DEFAULT NULL, `blocked_item_types` varchar(255) DEFAULT NULL, `checked_in_ok` tinyint(1) DEFAULT NULL, `convert_nonprinting_characters` varchar(10) DEFAULT NULL, @@ -6204,7 +6204,7 @@ CREATE TABLE `sip_accounts` ( `ct_always_send` tinyint(1) DEFAULT NULL, `cv_send_00_on_success` tinyint(1) DEFAULT NULL, `cv_triggers_alert` tinyint(1) DEFAULT NULL, - `da_field_template` varchar(255) DEFAULT NULL, + `da_field_template` text DEFAULT NULL, `delimiter` varchar(10) DEFAULT '|', `disallow_overpayment` tinyint(1) DEFAULT NULL, `encoding` varchar(10) DEFAULT NULL,