BUGFIX: unique versioned indexes are now converted to standard indexes

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@113299 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2010-11-01 02:58:43 +00:00
parent 46dcd20e34
commit 92c7419767

View File

@ -285,6 +285,13 @@ class Versioned extends DataObjectDecorator {
(array)$fields
);
//Unique indexes will not work on versioned tables, so we'll convert them to standard indexes:
foreach($indexes as $key=>$index){
if(is_array($index) && strtolower($index['type'])=='unique'){
$indexes[$key]['type']='index';
}
}
$versionIndexes = array_merge(
array(
'RecordID_Version' => array('type' => 'unique', 'value' => 'RecordID,Version'),