@@ -, +, @@ borrower_attribute_types.mandatory --- installer/data/mysql/atomicupdate/bug_22844.perl | 14 ++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 15 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_22844.perl --- a/installer/data/mysql/atomicupdate/bug_22844.perl +++ a/installer/data/mysql/atomicupdate/bug_22844.perl @@ -0,0 +1,14 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'borrower_attribute_types', 'mandatory' ) ) { + $dbh->do(q| + ALTER TABLE borrower_attribute_types + ADD COLUMN mandatory TINYINT(1) NOT NULL DEFAULT 0 + AFTER class + |); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug XXXXX - Add borrower_attribute_types.mandatory)\n"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -222,6 +222,7 @@ CREATE TABLE `borrower_attribute_types` ( -- definitions for custom patron field `display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens `category_code` VARCHAR(10) NULL DEFAULT NULL,-- defines a category for an attribute_type `class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type + `mandatory` tinyint(1) NOT NULL DEFAULT 0, -- defines if the attribute is mandatory or not PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --