From 831f09be572ac48f08bd61d715ee1bbbd4450fdb Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Sun, 31 Jan 2016 11:21:00 +0000 Subject: [PATCH] Bug 15707 - Update DB Signed-off-by: Mark Tompsett --- installer/data/mysql/atomicupdate/library_groups.sql | 12 ++++++++++++ installer/data/mysql/kohastructure.sql | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/library_groups.sql diff --git a/installer/data/mysql/atomicupdate/library_groups.sql b/installer/data/mysql/atomicupdate/library_groups.sql new file mode 100644 index 0000000..d6d3425 --- /dev/null +++ b/installer/data/mysql/atomicupdate/library_groups.sql @@ -0,0 +1,12 @@ +CREATE TABLE library_groups ( + id INT(11) NOT NULL auto_increment, -- unique id for each group + parent_id INT(11) NULL DEFAULT NULL, -- if this is a child group, the id of the parent group + branchcode VARCHAR(10) NULL DEFAULT NULL, -- The branchcode of a branch belonging to the parent group + title VARCHAR(100) NULL DEFAULT NULL, -- Short description of the goup + description TEXT NULL DEFAULT NULL, -- Longer explanation of the group, if necessary + created_on DATETIME NOT NULL, -- Date and time of creation + updated_on DATETIME NULL DEFAULT NULL, -- Date and time of last + PRIMARY KEY id ( id ), + FOREIGN KEY (parent_id) REFERENCES library_groups(id) ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 514c13d..cd7dfa5 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3921,6 +3921,23 @@ CREATE TABLE `article_requests` ( CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +-- +-- Table structure for table 'library_groups' +-- + +CREATE TABLE library_groups ( + id INT(11) NOT NULL auto_increment, -- unique id for each group + parent_id INT(11) NULL DEFAULT NULL, -- if this is a child group, the id of the parent group + branchcode VARCHAR(10) NULL DEFAULT NULL, -- The branchcode of a branch belonging to the parent group + title VARCHAR(100) NULL DEFAULT NULL, -- Short description of the goup + description TEXT NULL DEFAULT NULL, -- Longer explanation of the group, if necessary + created_on DATETIME NOT NULL, -- Date and time of creation + updated_on DATETIME NULL DEFAULT NULL, -- Date and time of last + PRIMARY KEY id ( id ), + FOREIGN KEY (parent_id) REFERENCES library_groups(id) ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (branchcode) REFERENCES branches(branchcode) 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