Diff

plugins/mod_storage_sql.lua @ 13784:b30eaa74d35b 13.0

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.
author Kim Alvefur <zash@zash.se>
date Sun, 23 Mar 2025 12:15:16 +0100
parent 13780:40185fad7505
child 13832:5973a5d22ab5
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Sat Mar 22 11:53:15 2025 +0100
+++ b/plugins/mod_storage_sql.lua	Sun Mar 23 12:15:16 2025 +0100
@@ -885,16 +885,12 @@
 			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