mod_storage_sql: Be more specific when checking for old index in SQLite3
Prevents false positives in the odd case where something other than an
index with this name might exist.
--- a/plugins/mod_storage_sql.lua Fri Jun 16 23:57:15 2023 +0200
+++ b/plugins/mod_storage_sql.lua Sat Jun 17 00:00:21 2023 +0200
@@ -850,7 +850,7 @@
local indices = {};
engine:transaction(function ()
if params.driver == "SQLite3" then
- for row in engine:select [[SELECT "name" from "sqlite_schema" WHERE "name"='prosody_index';]] do
+ for row in engine:select [[SELECT "name" FROM "sqlite_schema" WHERE "type"='index' AND "tbl_name"='prosody' AND "name"='prosody_index';]] do
indices[row[1]] = true;
end
elseif params.driver == "PostgreSQL" then