From 5f96a936cd7e2a7d7d76bd220748c9da5b7e3583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Fri, 19 Mar 2021 12:52:15 +0200 Subject: [PATCH] Bug 20447: Make holdings suppress column boolean object This enables Koha::Object::TO_JSON to return JSON boolean values. If we need to add supression to other parts of Koha than just OPAC in the future maybe it could have it in its own separate column (instead of using supress int values to represent different levels of supression). So using suppress column just for OPAC should be fine. --- installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.perl | 2 +- installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.perl b/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.perl index 663f0ec6a1..5614bbae3f 100644 --- a/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.perl +++ b/installer/data/mysql/atomicupdate/bug_20447-add_holdings_tables.perl @@ -10,7 +10,7 @@ if( CheckVersion( $DBversion ) ) { `location` varchar(80) default NULL, -- authorized value for the shelving location for this record (MARC21 852$b) `ccode` varchar(80) default NULL, -- authorized value for the collection code associated with this item (MARC21 852$g) `callnumber` varchar(255) default NULL, -- call number (852$h+$i in MARC21) - `suppress` tinyint(1) default NULL, -- Boolean indicating whether the record is suppressed in OPAC + `suppress` tinyint(1) NOT NULL DEFAULT 0, -- Boolean indicating whether the record is suppressed in OPAC `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched `datecreated` DATE NOT NULL, -- the date this record was added to Koha `deleted_on` DATETIME DEFAULT NULL, -- the date this record was deleted diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 53dca17d30..7c7523fef9 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2651,7 +2651,7 @@ CREATE TABLE `holdings` ( `location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the shelving location for this record (MARC21 852$b)', `ccode` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the collection code associated with this item (MARC21 852$g)', `callnumber` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'call number (852$h+$i in MARC21)', - `suppress` tinyint(1) DEFAULT NULL COMMENT 'Boolean indicating whether the record is suppressed in OPAC', + `suppress` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Boolean indicating whether the record is suppressed in OPAC', `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'date and time this record was last touched', `datecreated` date NOT NULL COMMENT 'the date this record was added to Koha', `deleted_on` datetime DEFAULT NULL COMMENT 'the date this record was deleted', -- 2.11.0