Comparison

core/storagemanager.lua @ 6951:99de8f30d99e

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
author Matthew Wild <mwild1@gmail.com>
date Thu, 03 Dec 2015 14:57:49 +0000
parent 6949:1c2c3d913172
child 6952:db085e55555f
child 7150:fcaaafe4062f
comparison
equal deleted inserted replaced
6950:8ab809358922 6951:99de8f30d99e
56 end 56 end
57 return stores_available:get(host, driver_name); 57 return stores_available:get(host, driver_name);
58 end 58 end
59 59
60 local function get_storage_config(host) 60 local function get_storage_config(host)
61 return config.get(host, "storage"); 61 -- COMPAT w/ unreleased Prosody 0.10 and the once-experimental mod_storage_sql2 in peoples' config files
62 local storage_config = config.get(host, "storage");
63 local found_sql2;
64 if storage_config == "sql2" then
65 storage_config, found_sql2 = "sql", true;
66 elseif type(storage_config) == "table" then
67 for store_name, driver_name in pairs(storage_config) do
68 if driver_name == "sql2" then
69 storage_config[store_name] = "sql";
70 found_sql2 = true;
71 end
72 end
73 end
74 if found_sql2 then
75 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");
76 end
77 return storage_config;
62 end 78 end
63 79
64 local function get_driver(host, store) 80 local function get_driver(host, store)
65 local storage = get_storage_config(host); 81 local storage = get_storage_config(host);
66 local driver_name; 82 local driver_name;