Comparison

plugins/mod_storage_sql.lua @ 4317:5b0fcc5cdd4d

mod_storage_sql: Add sql_manage_tables to disable table creation/updating.
author Matthew Wild <mwild1@gmail.com>
date Sat, 11 Jun 2011 02:15:38 +0100
parent 4309:7ad81d81f5ec
child 4318:44b131d7041b
comparison
equal deleted inserted replaced
4315:51706d2b9f77 4317:5b0fcc5cdd4d
63 return connection; 63 return connection;
64 end 64 end
65 end 65 end
66 66
67 local function create_table() 67 local function create_table()
68 if not module:get_option("sql_manage_tables", true) then
69 return;
70 end
68 local create_sql = "CREATE TABLE `prosody` (`host` TEXT, `user` TEXT, `store` TEXT, `key` TEXT, `type` TEXT, `value` TEXT);"; 71 local create_sql = "CREATE TABLE `prosody` (`host` TEXT, `user` TEXT, `store` TEXT, `key` TEXT, `type` TEXT, `value` TEXT);";
69 if params.driver == "PostgreSQL" then 72 if params.driver == "PostgreSQL" then
70 create_sql = create_sql:gsub("`", "\""); 73 create_sql = create_sql:gsub("`", "\"");
71 elseif params.driver == "MySQL" then 74 elseif params.driver == "MySQL" then
72 create_sql = create_sql:gsub("`value` TEXT", "`value` MEDIUMTEXT"); 75 create_sql = create_sql:gsub("`value` TEXT", "`value` MEDIUMTEXT");