mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
f9a84974b6
commit
92c04a6a1c
@ -319,20 +319,20 @@ class Versioned extends DataObjectDecorator {
|
|||||||
$count = DB::query("
|
$count = DB::query("
|
||||||
SELECT COUNT(*) FROM \"{$table}_versions\"
|
SELECT COUNT(*) FROM \"{$table}_versions\"
|
||||||
LEFT JOIN \"{$child}_versions\"
|
LEFT JOIN \"{$child}_versions\"
|
||||||
ON \"{$child}_versions\".RecordID = \"{$table}_versions\".RecordID
|
ON \"{$child}_versions\".\"RecordID\" = \"{$table}_versions\".\"RecordID\"
|
||||||
AND \"{$child}_versions\".Version = \"{$table}_versions\".Version
|
AND \"{$child}_versions\".\"Version\" = \"{$table}_versions\".\"Version\"
|
||||||
WHERE \"{$child}_versions\".ID IS NULL
|
WHERE \"{$child}_versions\".\"ID\" IS NULL
|
||||||
")->value();
|
")->value();
|
||||||
|
|
||||||
if($count > 0) {
|
if($count > 0) {
|
||||||
DB::alteration_message("Removing orphaned versioned records", "deleted");
|
DB::alteration_message("Removing orphaned versioned records", "deleted");
|
||||||
|
|
||||||
$effectedIDs = DB::query("
|
$effectedIDs = DB::query("
|
||||||
SELECT \"{$table}_versions\".ID FROM \"{$table}_versions\"
|
SELECT \"{$table}_versions\".\"ID\" FROM \"{$table}_versions\"
|
||||||
LEFT JOIN \"{$child}_versions\"
|
LEFT JOIN \"{$child}_versions\"
|
||||||
ON \"{$child}_versions\".RecordID = \"{$table}_versions\".RecordID
|
ON \"{$child}_versions\".\"RecordID\" = \"{$table}_versions\".\"RecordID\"
|
||||||
AND \"{$child}_versions\".Version = \"{$table}_versions\".Version
|
AND \"{$child}_versions\".\"Version\" = \"{$table}_versions\".\"Version\"
|
||||||
WHERE \"{$child}_versions\".ID IS NULL
|
WHERE \"{$child}_versions\".\"ID\" IS NULL
|
||||||
")->column();
|
")->column();
|
||||||
|
|
||||||
if(is_array($effectedIDs)) {
|
if(is_array($effectedIDs)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user