mod_storage_sql: Add sql_manage_tables to disable table creation/updating.
authorMatthew Wild <mwild1@gmail.com>
Sat, 11 Jun 2011 01:15:38 +0000 (02:15 +0100)
committerMatthew Wild <mwild1@gmail.com>
Sat, 11 Jun 2011 01:15:38 +0000 (02:15 +0100)
plugins/mod_storage_sql.lua

index 055d6599a69e63aa1a76515b797ed9ec15b38545..59583def2bf4ef82e77e72f28809af32fe4d656f 100644 (file)
@@ -65,6 +65,9 @@ local function connect()
 end
 
 local function create_table()
+       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
                create_sql = create_sql:gsub("`", "\"");