Bug 41460: Remove default value from mediumtext column systempreferences.value

Mysql doesn't allow text type columns to have a default.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
Michael Hafen 2025-12-16 11:40:30 -07:00 committed by Martin Renvoize
parent 1544020e57
commit 7cebccb76f
No known key found for this signature in database
GPG Key ID: 2D86E0EAEC83711B
3 changed files with 20 additions and 2 deletions

View File

@ -0,0 +1,18 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "41460",
description => "Remove column default from systempreferences.value",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
# Do you stuffs here
$dbh->do(q{MODIFY COLUMN `value` mediumtext NOT NULL COMMENT 'system preference values'});
# Print useful stuff here
# tables
say $out "Removed default from column 'systempreferences.value'";
},
};

View File

@ -23,7 +23,7 @@ return {
$dbh->do(
q{
ALTER TABLE systempreferences
MODIFY COLUMN `value` mediumtext NOT NULL DEFAULT '' COMMENT 'system preference values'
MODIFY COLUMN `value` mediumtext NOT NULL COMMENT 'system preference values'
}
);
},

View File

@ -6695,7 +6695,7 @@ DROP TABLE IF EXISTS `systempreferences`;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `systempreferences` (
`variable` varchar(50) NOT NULL DEFAULT '' COMMENT 'system preference name',
`value` mediumtext NOT NULL DEFAULT '' COMMENT 'system preference values',
`value` mediumtext NOT NULL COMMENT 'system preference values',
`options` longtext DEFAULT NULL COMMENT 'options for multiple choice system preferences',
`explanation` mediumtext DEFAULT NULL COMMENT 'descriptive text for the system preference',
`type` varchar(20) DEFAULT NULL COMMENT 'type of question this preference asks (multiple choice, plain text, yes or no, etc)',