diff --git a/installer/data/mysql/atomicupdate/bug_17216_1_add_table.sql b/installer/data/mysql/atomicupdate/bug_17216_1_add_table.sql index cc5ac6ee5b..07dcb83734 100644 --- a/installer/data/mysql/atomicupdate/bug_17216_1_add_table.sql +++ b/installer/data/mysql/atomicupdate/bug_17216_1_add_table.sql @@ -45,3 +45,5 @@ ALTER TABLE items_search_fields DROP FOREIGN KEY items_search_fields_authorised_values_category; ALTER TABLE items_search_fields ADD CONSTRAINT `items_search_fields_authorised_values_category` FOREIGN KEY (`authorised_values_category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE authorised_values + ADD CONSTRAINT `authorised_values_authorised_values_category` FOREIGN KEY (`category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index b97773fa79..f00b63b91a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -118,7 +118,8 @@ CREATE TABLE `authorised_values` ( -- stores values for authorized values catego PRIMARY KEY (`id`), KEY `name` (`category`), KEY `lib` (`lib`), - KEY `auth_value_idx` (`authorised_value`) + KEY `auth_value_idx` (`authorised_value`), + CONSTRAINT `authorised_values_authorised_values_category` FOREIGN KEY (`category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; --