BUGFIX Fixed double quotes around column names in Versioned::augmentDatabase()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110914 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-09-17 03:36:19 +00:00 committed by Sam Minnee
parent f9a84974b6
commit 92c04a6a1c

View File

@ -319,20 +319,20 @@ class Versioned extends DataObjectDecorator {
$count = DB::query("
SELECT COUNT(*) FROM \"{$table}_versions\"
LEFT JOIN \"{$child}_versions\"
ON \"{$child}_versions\".RecordID = \"{$table}_versions\".RecordID
AND \"{$child}_versions\".Version = \"{$table}_versions\".Version
WHERE \"{$child}_versions\".ID IS NULL
ON \"{$child}_versions\".\"RecordID\" = \"{$table}_versions\".\"RecordID\"
AND \"{$child}_versions\".\"Version\" = \"{$table}_versions\".\"Version\"
WHERE \"{$child}_versions\".\"ID\" IS NULL
")->value();
if($count > 0) {
DB::alteration_message("Removing orphaned versioned records", "deleted");
$effectedIDs = DB::query("
SELECT \"{$table}_versions\".ID FROM \"{$table}_versions\"
SELECT \"{$table}_versions\".\"ID\" FROM \"{$table}_versions\"
LEFT JOIN \"{$child}_versions\"
ON \"{$child}_versions\".RecordID = \"{$table}_versions\".RecordID
AND \"{$child}_versions\".Version = \"{$table}_versions\".Version
WHERE \"{$child}_versions\".ID IS NULL
ON \"{$child}_versions\".\"RecordID\" = \"{$table}_versions\".\"RecordID\"
AND \"{$child}_versions\".\"Version\" = \"{$table}_versions\".\"Version\"
WHERE \"{$child}_versions\".\"ID\" IS NULL
")->column();
if(is_array($effectedIDs)) {