aboutsummaryrefslogtreecommitdiffstats
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
commit9b8315dd292d744f26daabe4afbc7d94e09bb61a (patch)
treeeb9fcc9450968ce3646acbfd2b0004991470ddb0
parentacefadc54b01fb4fe76fc9418b44798d5b09c8c6 (diff)
downloadprosody-9b8315dd292d744f26daabe4afbc7d94e09bb61a.tar.gz
prosody-9b8315dd292d744f26daabe4afbc7d94e09bb61a.zip
mod_storage_sql2: Move checking of the sql_manage_tables option so it also includes table upgrades (again)
-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)