aboutsummaryrefslogtreecommitdiffstats
path: root/core/storagemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-12-03 14:57:49 +0000
committerMatthew Wild <mwild1@gmail.com>2015-12-03 14:57:49 +0000
commitd3b6588fd79e85777cf5c6af4fd870c297dc7daf (patch)
tree113cfb25fd9e9b0ecac9b3dc71eb84516ebd8569 /core/storagemanager.lua
parent12f9aac248d944f00645fc438f95e53dbee21128 (diff)
downloadprosody-d3b6588fd79e85777cf5c6af4fd870c297dc7daf.tar.gz
prosody-d3b6588fd79e85777cf5c6af4fd870c297dc7daf.zip
storagemanager, mod_storage_sql, mod_storage_sql2: Rename mod_storage_sql2 -> mod_storage_sql, mod_storage_sql -> mod_storage_sql1 (temporarily), and emit warning for configs using sql2
Diffstat (limited to 'core/storagemanager.lua')
-rw-r--r--core/storagemanager.lua18
1 files changed, 17 insertions, 1 deletions
diff --git a/core/storagemanager.lua b/core/storagemanager.lua
index 21f5fd1d..c312cf05 100644
--- a/core/storagemanager.lua
+++ b/core/storagemanager.lua
@@ -58,7 +58,23 @@ local function load_driver(host, driver_name)
end
local function get_storage_config(host)
- return config.get(host, "storage");
+ -- COMPAT w/ unreleased Prosody 0.10 and the once-experimental mod_storage_sql2 in peoples' config files
+ local storage_config = config.get(host, "storage");
+ local found_sql2;
+ if storage_config == "sql2" then
+ storage_config, found_sql2 = "sql", true;
+ elseif type(storage_config) == "table" then
+ for store_name, driver_name in pairs(storage_config) do
+ if driver_name == "sql2" then
+ storage_config[store_name] = "sql";
+ found_sql2 = true;
+ end
+ end
+ end
+ if found_sql2 then
+ log("error", "The temporary 'sql2' storage module has now been renamed to 'sql', please update your config file: https://prosody.im/doc/modules/mod_storage_sql2");
+ end
+ return storage_config;
end
local function get_driver(host, store)