BUGFIX: Ensure that all_versions are sorted explicitly for better cross-db behaviour.

This commit is contained in:
Sam Minnee 2012-08-21 16:23:33 +12:00
parent f6334dd017
commit dd302a68a7

View File

@ -228,6 +228,7 @@ class Versioned extends DataExtension {
$query->selectField(sprintf('"%s_versions"."%s"', $baseTable, $name), $name);
}
$query->selectField(sprintf('"%s_versions"."%s"', $baseTable, 'RecordID'), "ID");
$query->addOrderBy(sprintf('"%s_versions"."%s"', $baseTable, 'Version'));
// latest_version has one more step
// Return latest version instances, regardless of whether they are on a particular stage