mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
added indices (merged from branches/2.2.0@45907, r45542)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46108 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9c6f7345b0
commit
27c70de07e
@ -474,9 +474,18 @@ class Translatable extends DataObjectDecorator {
|
||||
foreach ($indexes as $index => $type) {
|
||||
if (true === $type && array_search($index,$langFields) === false) unset($indexes[$index]);
|
||||
}
|
||||
|
||||
$langIndexes = array_merge(
|
||||
array(
|
||||
'OriginalLangID_Lang' => '(OriginalLangID, Lang)',
|
||||
'OriginalLangID' => true,
|
||||
'Lang' => true,
|
||||
),
|
||||
(array)$indexes
|
||||
);
|
||||
|
||||
// Create table for translated instances
|
||||
DB::requireTable("{$table}_lang", $langFields, $indexes);
|
||||
DB::requireTable("{$table}_lang", $langFields, $langIndexes);
|
||||
|
||||
} else {
|
||||
DB::dontRequireTable("{$table}_lang");
|
||||
|
Loading…
Reference in New Issue
Block a user