mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: unique indexes on versioned tables now changed to 'index'
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@114134 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f1bf0d0fc4
commit
196cabb2f0
@ -249,6 +249,13 @@ class Versioned extends DataObjectDecorator {
|
|||||||
// Create tables for other stages
|
// Create tables for other stages
|
||||||
foreach($this->stages as $stage) {
|
foreach($this->stages as $stage) {
|
||||||
// Extra tables for _Live, etc.
|
// Extra tables for _Live, etc.
|
||||||
|
//Change unique indexes to 'index'. Versioned tables may run into unique indexing difficulties otherwise.
|
||||||
|
foreach($indexes as $key=>$index){
|
||||||
|
if(is_array($index) && $index['type']=='unique'){
|
||||||
|
$indexes[$key]['type']='index';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($stage != $this->defaultStage) {
|
if($stage != $this->defaultStage) {
|
||||||
DB::requireTable("{$table}_$stage", $fields, $indexes, false);
|
DB::requireTable("{$table}_$stage", $fields, $indexes, false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user