@@ -, +, @@ --- 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 --- a/installer/data/mysql/atomicupdate/library_groups.sql +++ a/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; --- a/installer/data/mysql/kohastructure.sql +++ a/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 */; --