From 9d178613ad16d030ca9252d971f7efc615c8925f 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 Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- .../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 0000000000..d6d34251e3 --- /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 f031503ae8..07dbe68852 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4162,6 +4162,23 @@ CREATE TABLE illrequestattributes ( ON UPDATE CASCADE ON DELETE 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.20.1