View | Details | Raw Unified | Return to bug 22887
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_22887.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( q{ALTER TABLE `authorised_values` ADD CONSTRAINT `category_code` UNIQUE (category,authorised_value)} );
4
5
    # Always end with this (adjust the bug info)
6
    SetVersion( $DBversion );
7
    print "Upgrade to $DBversion done (Bug 22887 - Add unique constraint to authorised_values)\n";
8
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 119-124 CREATE TABLE `authorised_values` ( -- stores values for authorized values catego Link Here
119
  KEY `name` (`category`),
119
  KEY `name` (`category`),
120
  KEY `lib` (`lib` (191)),
120
  KEY `lib` (`lib` (191)),
121
  KEY `auth_value_idx` (`authorised_value`),
121
  KEY `auth_value_idx` (`authorised_value`),
122
  CONSTRAINT `category_code` UNIQUE (`category`,`authorised_value`),
122
  CONSTRAINT `authorised_values_authorised_values_category` FOREIGN KEY (`category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE CASCADE ON UPDATE CASCADE
123
  CONSTRAINT `authorised_values_authorised_values_category` FOREIGN KEY (`category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE CASCADE ON UPDATE CASCADE
123
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
124
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
124
125
125
- 

Return to bug 22887