aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-04-11 17:01:55 +0100
committerMatthew Wild <mwild1@gmail.com>2011-04-11 17:01:55 +0100
commit4e9c185a7756bd5941fe67238084bc3bf963df0a (patch)
tree2bc801cb99f9dbb9de592a6032c808d632b0da86
parente279ce521d978ff817bf575d4a2c2d61a534e5de (diff)
parent32c59705844af149a3b9fa29d82b7579f4536c42 (diff)
downloadprosody-4e9c185a7756bd5941fe67238084bc3bf963df0a.tar.gz
prosody-4e9c185a7756bd5941fe67238084bc3bf963df0a.zip
Merge 0.8->trunk
-rw-r--r--tools/migration/migrator/prosody_sql.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/migration/migrator/prosody_sql.lua b/tools/migration/migrator/prosody_sql.lua
index b1f836be..50ae8c40 100644
--- a/tools/migration/migrator/prosody_sql.lua
+++ b/tools/migration/migrator/prosody_sql.lua
@@ -149,7 +149,11 @@ function writer(output, iter)
assert(stmt:execute());
local stmt = assert(dbh:prepare("DELETE FROM prosody"));
assert(stmt:execute());
- local insert = assert(dbh:prepare("INSERT INTO `prosody` (`host`,`user`,`store`,`key`,`type`,`value`) VALUES (?,?,?,?,?,?)"));
+ local insert_sql = "INSERT INTO `prosody` (`host`,`user`,`store`,`key`,`type`,`value`) VALUES (?,?,?,?,?,?)";
+ if output.driver == "PostgreSQL" then
+ insert_sql = insert_sql:gsub("`", "\"");
+ end
+ local insert = assert(dbh:prepare(insert_sql));
return function(item)
if not item then assert(dbh:commit()) return dbh:close(); end -- end of input