From ad1049a0cb686626f96f45f3be1465df63071a90 Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Mon, 10 Oct 2016 12:37:50 +0200 Subject: [PATCH] Bug 5670: [QA Followup] Create housebound roles table. * installer/data/mysql/atomicupdate/housebound_tables.sql (housebound_role): New table. * installer/data/mysql/kohastructure.sql (housebound_role): New table. * installer/data/mysql/en/mandatory/auth_values.sql: Remove HSBND_ROLE entries. * installer/data/mysql/en/mandatory/patron_attributes.sql: Remove HSBND_ROLE entry. * installer/data/mysql/en/mandatory/patron_attributes.txt: Remove explanatory text. Signed-off-by: Claire Gravely --- .../data/mysql/atomicupdate/housebound_tables.sql | 20 ++++++++++++-------- installer/data/mysql/en/mandatory/auth_values.sql | 5 +---- .../data/mysql/en/mandatory/patron_attributes.sql | 4 ---- .../data/mysql/en/mandatory/patron_attributes.txt | 2 -- installer/data/mysql/kohastructure.sql | 16 ++++++++++++++++ 5 files changed, 29 insertions(+), 18 deletions(-) diff --git a/installer/data/mysql/atomicupdate/housebound_tables.sql b/installer/data/mysql/atomicupdate/housebound_tables.sql index 3219ade..49c3237 100644 --- a/installer/data/mysql/atomicupdate/housebound_tables.sql +++ b/installer/data/mysql/atomicupdate/housebound_tables.sql @@ -36,17 +36,21 @@ CREATE TABLE IF NOT EXISTS `housebound_visit` ( ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +CREATE TABLE IF NOT EXISTS `housebound_role` ( + `borrowernumber_id` int(11) NOT NULL, -- borrowernumber link + `housebound_chooser` tinyint(1) NOT NULL DEFAULT 0, -- set to 1 to indicate this patron is a housebound chooser volunteer + `housebound_deliverer` tinyint(1) NOT NULL DEFAULT 0, -- set to 1 to indicate this patron is a housebound deliverer volunteer + PRIMARY KEY (`borrowernumber_id`), + CONSTRAINT `houseboundrole_bnfk` + FOREIGN KEY (`borrowernumber_id`) + REFERENCES `borrowers` (`borrowernumber`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('HouseboundModule',0,'', 'If ON, enable housebound module functionality.','YesNo'); INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES - ('HSBND_FREQ','EW','Every week'), - ('HSBND_ROLE','CHO','Chooser'), - ('HSBND_ROLE','DEL','Deliverer'); - -INSERT IGNORE INTO borrower_attribute_types - (code, description, repeatable, opac_display, staff_searchable, - authorised_value_category, display_checkout) values - ('HSBND', 'Housebound role', 1, 1, 1, 'HSBND_ROLE', 1); + ('HSBND_FREQ','EW','Every week'); diff --git a/installer/data/mysql/en/mandatory/auth_values.sql b/installer/data/mysql/en/mandatory/auth_values.sql index 511b096..26328ef 100644 --- a/installer/data/mysql/en/mandatory/auth_values.sql +++ b/installer/data/mysql/en/mandatory/auth_values.sql @@ -1,6 +1,3 @@ INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('YES_NO','0','No','No'); INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('YES_NO','1','Yes','Yes'); -INSERT INTO authorised_values (category, authorised_value, lib) VALUES - ('HSBND_FREQ','EW','Every week'), - ('HSBND_ROLE','CHO','Chooser'), - ('HSBND_ROLE','DEL','Deliverer'); +INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HSBND_FREQ','EW','Every week'); diff --git a/installer/data/mysql/en/mandatory/patron_attributes.sql b/installer/data/mysql/en/mandatory/patron_attributes.sql index 89845ad..e69de29 100644 --- a/installer/data/mysql/en/mandatory/patron_attributes.sql +++ b/installer/data/mysql/en/mandatory/patron_attributes.sql @@ -1,4 +0,0 @@ -INSERT INTO borrower_attribute_types - (code, description, repeatable, opac_display, staff_searchable, - authorised_value_category, display_checkout) values - ('HSBND', 'Housebound role', 1, 1, 1, 'HSBND_ROLE', 1); diff --git a/installer/data/mysql/en/mandatory/patron_attributes.txt b/installer/data/mysql/en/mandatory/patron_attributes.txt index c2d0d4f..e69de29 100644 --- a/installer/data/mysql/en/mandatory/patron_attributes.txt +++ b/installer/data/mysql/en/mandatory/patron_attributes.txt @@ -1,2 +0,0 @@ -Default Koha system extended patron attributes: -* HSBND - Allow assignment of different housebound roles for volunteers diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e0d176b..e8da46d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3858,6 +3858,22 @@ CREATE TABLE `housebound_visit` ( ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +-- +-- Table structure for table `housebound_role` +-- + +DROP TABLE IF EXISTS `housebound_role`; +CREATE TABLE IF NOT EXISTS `housebound_role` ( + `borrowernumber_id` int(11) NOT NULL, -- borrowernumber link + `housebound_chooser` tinyint(1) NOT NULL DEFAULT 0, -- set to 1 to indicate this patron is a housebound chooser volunteer + `housebound_deliverer` tinyint(1) NOT NULL DEFAULT 0, -- set to 1 to indicate this patron is a housebound deliverer volunteer + PRIMARY KEY (`borrowernumber_id`), + CONSTRAINT `houseboundvisit_bnfk` + FOREIGN KEY (`borrowernumber_id`) + REFERENCES `borrowers` (`borrowernumber`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -- 2.1.4