aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_storage_sql.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 3b20b3cc..3afb5d78 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -850,7 +850,7 @@ local function upgrade_table(engine, params, apply_changes) -- luacheck: ignore
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