mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
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.
This commit is contained in:
parent
6959547703
commit
b9d4cc24df
1 changed files with 6 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue