From 367fc46cc36ce2fd0b9c71c970a4479e4e530f82 Mon Sep 17 00:00:00 2001 From: callumbirks <73551885+callumbirks@users.noreply.github.com> Date: Mon, 24 Jun 2024 20:42:56 +0100 Subject: [PATCH] Migrate index table if necessary in getIndex. (#2077) --- LiteCore/Query/SQLiteDataFile+Indexes.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LiteCore/Query/SQLiteDataFile+Indexes.cc b/LiteCore/Query/SQLiteDataFile+Indexes.cc index 6bc2ec9d2..ee8af69ed 100644 --- a/LiteCore/Query/SQLiteDataFile+Indexes.cc +++ b/LiteCore/Query/SQLiteDataFile+Indexes.cc @@ -202,7 +202,7 @@ namespace litecore { // Gets info of a single index. (Subroutine of create/deleteIndex.) optional SQLiteDataFile::getIndex(slice name) { - if ( !indexTableExists() ) return nullopt; + ensureIndexTableExists(); SQLite::Statement stmt(*this, "SELECT name, type, expression, keyStore, " "indexTableName, lastSeq " "FROM indexes WHERE name=?");