@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_17216_1_add_table.sql | 2 ++ installer/data/mysql/kohastructure.sql | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) --- a/installer/data/mysql/atomicupdate/bug_17216_1_add_table.sql +++ a/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; --- a/installer/data/mysql/kohastructure.sql +++ a/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; -- --