From f925ba7723bf4336b6ad7089e5cfb8841d5ffa4a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 28 Oct 2013 22:08:46 +0100 Subject: mod_storage_sql2: Move checking of the sql_manage_tables option so it also includes table upgrades (again) --- plugins/mod_storage_sql2.lua | 13 ++++++------- 1 file 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) -- cgit v1.2.3