From b87fdec6da2c3bee74180b5a8611645a718e1e5b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Apr 2020 11:29:21 +0200 Subject: [PATCH] Bug 25152: Make subscription.closed tinyint(1) https://wiki.koha-community.org/wiki/Coding_Guidelines#SQL12:_Booleans Boolean fields must be tinyint(1), not int(1) Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug_25152.perl | 6 ++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_25152.perl diff --git a/installer/data/mysql/atomicupdate/bug_25152.perl b/installer/data/mysql/atomicupdate/bug_25152.perl new file mode 100644 index 0000000000..5980a8f0e8 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_25152.perl @@ -0,0 +1,6 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE subscription MODIFY COLUMN closed tinyint(1) not null default 0" ); + + NewVersion( $DBversion, 25152, "Description"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 693ecf1be1..740b5958c8 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1994,7 +1994,7 @@ CREATE TABLE `subscription` ( -- information related to the subscription `opacdisplaycount` VARCHAR(10) NULL, -- how many issues to show to the public `graceperiod` int(11) NOT NULL default '0', -- grace period in days `enddate` date default NULL, -- subscription end date - `closed` INT(1) NOT NULL DEFAULT 0, -- yes / no if the subscription is closed + `closed` TINYINT(1) NOT NULL DEFAULT 0, -- yes / no if the subscription is closed `reneweddate` date default NULL, -- date of last renewal for the subscription `itemtype` VARCHAR( 10 ) NULL, `previousitemtype` VARCHAR( 10 ) NULL, -- 2.39.5