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
commit6871f12122b5acc275534c4f03c1e5f6cd7487f6 (patch)
tree2bc801cb99f9dbb9de592a6032c808d632b0da86
parentcd61345de21533fd8415e20818851ebc362c94f1 (diff)
parent32c59705844af149a3b9fa29d82b7579f4536c42 (diff)
downloadprosody-6871f12122b5acc275534c4f03c1e5f6cd7487f6.tar.gz
prosody-6871f12122b5acc275534c4f03c1e5f6cd7487f6.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