From fb1e8576d6e47fcb0fc6da88ce8b61377e36651d Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 25 Nov 2024 15:59:03 -0400 Subject: [PATCH] Add sorts, for sanity. --- src/Drush/Commands/Sec873DrushCommands.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Drush/Commands/Sec873DrushCommands.php b/src/Drush/Commands/Sec873DrushCommands.php index 7c9a4da..9815546 100644 --- a/src/Drush/Commands/Sec873DrushCommands.php +++ b/src/Drush/Commands/Sec873DrushCommands.php @@ -202,7 +202,7 @@ public function getCurrent(array $options = []) : void { foreach ($this->getTargetTables() as $info) { $target_field = "{$info['field_name']}_target_id"; $query = $this->getQuery($info['table_name'], $target_field); - $ids_alias = $query->addExpression("STRING_AGG(t.entity_id::varchar, ',')", "entity_ids"); + $ids_alias = $query->addExpression("STRING_AGG(t.entity_id::varchar, ',' ORDER BY t.entity_id ASC)", "entity_ids"); $id_count_alias = $query->getMetaData(static::COUNT_META); $results = $query->execute(); foreach ($results as $result) { @@ -247,7 +247,7 @@ public function getRevisions(array $options = []) : void { $existence_query->where("[t].{$target_field} = [tt].{$target_field} AND [t].entity_id != [tt].entity_id"); $query->exists($existence_query); - $ids_alias = $query->addExpression("STRING_AGG(t.entity_id::text || ':'::text || t.revision_id::text, ',')", "entity_ids"); + $ids_alias = $query->addExpression("STRING_AGG(t.entity_id::text || ':'::text || t.revision_id::text, ',' ORDER BY t.entity_id ASC, t.revision_id ASC)", "entity_ids"); $id_count_alias = $query->getMetaData(static::COUNT_META); $results = $query->execute(); foreach ($results as $result) {