From b9d4cc24df312019b90d6ee60447cfa13050805c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 23 Mar 2025 12:15:16 +0100 Subject: mod_storage_sql: Drop legacy index without confirmation to ease upgrades Deleting one index should be safe enough to do without requiring a explicitly upgrading during downtime. People had trouble with this. --- plugins/mod_storage_sql.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 5f80fad7..f053f729 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -885,16 +885,12 @@ local function upgrade_table(engine, params, apply_changes) -- luacheck: ignore end end) if indices["prosody_index"] then - if apply_changes then - local success = engine:transaction(function () - return assert(engine:execute([[DROP INDEX "prosody_index";]])); - end); - if not success then - module:log("error", "Failed to delete obsolete index \"prosody_index\""); - return false; - end - else - changes = true; + local success = engine:transaction(function () + return assert(engine:execute([[DROP INDEX "prosody_index";]])); + end); + if not success then + module:log("error", "Failed to delete obsolete index \"prosody_index\""); + return false; end end end -- cgit v1.2.3