Changeset

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
parents 13782:4cfabfbb0691
children 13785:d7e54a2475cc
files plugins/mod_storage_sql.lua
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
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