From f04d163d983ab9269674e51c6351203b38fc37cd Mon Sep 17 00:00:00 2001 From: Graham Date: Tue, 23 Mar 2021 20:19:55 +0000 Subject: [PATCH] Add non-truncated version numbers to the collisions view Will be useful for determining if a collision is caused by version truncation. Signed-off-by: Graham --- .../org/openrs2/archive/migrations/V1__init.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/archive/src/main/resources/org/openrs2/archive/migrations/V1__init.sql b/archive/src/main/resources/org/openrs2/archive/migrations/V1__init.sql index 41a83ccf82..41dffefbf0 100644 --- a/archive/src/main/resources/org/openrs2/archive/migrations/V1__init.sql +++ b/archive/src/main/resources/org/openrs2/archive/migrations/V1__init.sql @@ -275,8 +275,14 @@ LEFT JOIN ( CREATE UNIQUE INDEX ON master_index_stats (master_index_id); -CREATE VIEW collisions (archive_id, group_id, crc32, truncated_version, containers) AS -SELECT g.archive_id, g.group_id, c.crc32, g.version & 65535 AS truncated_version, array_agg(DISTINCT c.id ORDER BY c.id ASC) +CREATE VIEW collisions (archive_id, group_id, crc32, truncated_version, versions, containers) AS +SELECT + g.archive_id, + g.group_id, + c.crc32, + g.version & 65535 AS truncated_version, + array_agg(DISTINCT g.version ORDER BY g.version ASC), + array_agg(DISTINCT c.id ORDER BY c.id ASC) FROM groups g JOIN containers c ON c.id = g.container_id GROUP BY g.archive_id, g.group_id, c.crc32, truncated_version