Software / code / prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
| 13782:4cfabfbb0691 | 13784:b30eaa74d35b |
|---|---|
| 883 indices[row[1]] = true; | 883 indices[row[1]] = true; |
| 884 end | 884 end |
| 885 end | 885 end |
| 886 end) | 886 end) |
| 887 if indices["prosody_index"] then | 887 if indices["prosody_index"] then |
| 888 if apply_changes then | 888 local success = engine:transaction(function () |
| 889 local success = engine:transaction(function () | 889 return assert(engine:execute([[DROP INDEX "prosody_index";]])); |
| 890 return assert(engine:execute([[DROP INDEX "prosody_index";]])); | 890 end); |
| 891 end); | 891 if not success then |
| 892 if not success then | 892 module:log("error", "Failed to delete obsolete index \"prosody_index\""); |
| 893 module:log("error", "Failed to delete obsolete index \"prosody_index\""); | 893 return false; |
| 894 return false; | |
| 895 end | |
| 896 else | |
| 897 changes = true; | |
| 898 end | 894 end |
| 899 end | 895 end |
| 900 end | 896 end |
| 901 return changes; | 897 return changes; |
| 902 end | 898 end |