From a3593e9326bffc396cd3c04c6c6588567e5b90fb Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 31 Jan 2021 22:38:57 +0000 Subject: [PATCH] Rename master_index_entries to master_index_archives This naming is a bit more consistent with the index_groups and index_files tables. Signed-off-by: Graham --- .../kotlin/org/openrs2/archive/cache/CacheExporter.kt | 10 +++++----- .../kotlin/org/openrs2/archive/cache/CacheImporter.kt | 2 +- .../main/resources/org/openrs2/archive/V1__init.sql | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt index 4872b0abfd..669b6063e1 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheExporter.kt @@ -20,12 +20,12 @@ public class CacheExporter @Inject constructor( connection.prepareStatement( """ WITH t AS ( - SELECT e.archive_id, c.data, g.container_id + SELECT a.archive_id, c.data, g.container_id FROM master_indexes m - JOIN master_index_entries e ON e.container_id = m.container_id - JOIN groups g ON g.archive_id = 255 AND g.group_id = e.archive_id::INTEGER AND g.truncated_version = e.version & 65535 - JOIN containers c ON c.id = g.container_id AND c.crc32 = e.crc32 - JOIN indexes i ON i.container_id = g.container_id AND i.version = e.version + JOIN master_index_archives a ON a.container_id = m.container_id + JOIN groups g ON g.archive_id = 255 AND g.group_id = a.archive_id::INTEGER AND g.truncated_version = a.version & 65535 + JOIN containers c ON c.id = g.container_id AND c.crc32 = a.crc32 + JOIN indexes i ON i.container_id = g.container_id AND i.version = a.version WHERE m.container_id = ? ) SELECT 255::uint1, t.archive_id::INTEGER, t.data, NULL diff --git a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt index 87b81d0ae6..b5c9bd3279 100644 --- a/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt +++ b/archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt @@ -339,7 +339,7 @@ public class CacheImporter @Inject constructor( connection.prepareStatement( """ - INSERT INTO master_index_entries (container_id, archive_id, crc32, version) + INSERT INTO master_index_archives (container_id, archive_id, crc32, version) VALUES (?, ?, ?, ?) """.trimIndent() ).use { stmt -> diff --git a/archive/src/main/resources/org/openrs2/archive/V1__init.sql b/archive/src/main/resources/org/openrs2/archive/V1__init.sql index 09393ff18e..dff03f0a55 100644 --- a/archive/src/main/resources/org/openrs2/archive/V1__init.sql +++ b/archive/src/main/resources/org/openrs2/archive/V1__init.sql @@ -89,7 +89,7 @@ CREATE TABLE master_indexes ( timestamp TIMESTAMPTZ NULL ); -CREATE TABLE master_index_entries ( +CREATE TABLE master_index_archives ( container_id BIGINT NOT NULL REFERENCES master_indexes (container_id), archive_id uint1 NOT NULL, crc32 INTEGER NOT NULL,