diff options
author | Kim Alvefur <zash@zash.se> | 2025-03-23 12:15:16 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2025-03-23 12:15:16 +0100 |
commit | b9d4cc24df312019b90d6ee60447cfa13050805c (patch) | |
tree | 126af88357b0f9e8f91e6a1d8fb023ea2f72b24f /plugins | |
parent | 6959547703da2b8137005e391863e7e6399109a6 (diff) | |
download | prosody-b9d4cc24df312019b90d6ee60447cfa13050805c.tar.gz prosody-b9d4cc24df312019b90d6ee60447cfa13050805c.zip |
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.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_storage_sql.lua | 16 |
1 files changed, 6 insertions, 10 deletions
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 |