aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-10-28 22:08:46 +0100
committerKim Alvefur <zash@zash.se>2013-10-28 22:08:46 +0100
commitf925ba7723bf4336b6ad7089e5cfb8841d5ffa4a (patch)
treeeb9fcc9450968ce3646acbfd2b0004991470ddb0 /plugins
parente9935707592087e51ec0e6e63e3fd389407ebe9a (diff)
downloadprosody-f925ba7723bf4336b6ad7089e5cfb8841d5ffa4a.tar.gz
prosody-f925ba7723bf4336b6ad7089e5cfb8841d5ffa4a.zip
mod_storage_sql2: Move checking of the sql_manage_tables option so it also includes table upgrades (again)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_sql2.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua
index 0e6aca3a..4148024e 100644
--- a/plugins/mod_storage_sql2.lua
+++ b/plugins/mod_storage_sql2.lua
@@ -41,9 +41,6 @@ local function create_table()
engine:transaction(function()
ProsodyTable:create(engine);
end);]]
- if not module:get_option("sql_manage_tables", true) then
- return;
- end
local create_sql = "CREATE TABLE `prosody` (`host` TEXT, `user` TEXT, `store` TEXT, `key` TEXT, `type` TEXT, `value` TEXT);";
if params.driver == "PostgreSQL" then
@@ -138,10 +135,12 @@ do -- process options to get a db connection
engine:set_encoding();
- -- Automatically create table, ignore failure (table probably already exists)
- create_table();
- -- Encoding mess
- upgrade_table();
+ if module:get_option("sql_manage_tables", true) then
+ -- Automatically create table, ignore failure (table probably already exists)
+ create_table();
+ -- Encoding mess
+ upgrade_table();
+ end
end
local function serialize(value)