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:
Andrew O'Neil 2007-12-02 21:33:48 +00:00
parent 9c6f7345b0
commit 27c70de07e

View File

@ -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");