不要怂,就是干,撸起袖子干!

Commit 8dee56bc by Rob Raux

Postgres delete queries fail w/o calling sync due to no primary keys set

1 parent d4ed9d39
Showing with 2 additions and 0 deletions
...@@ -243,6 +243,8 @@ module.exports = (function() { ...@@ -243,6 +243,8 @@ module.exports = (function() {
options = options || {} options = options || {}
options.limit = options.limit || 1 options.limit = options.limit || 1
primaryKeys[tableName] = primaryKeys[tableName] || [];
var query = "DELETE FROM <%= table %> WHERE <%= primaryKeys %> IN (SELECT <%= primaryKeysSelection %> FROM <%= table %> WHERE <%= where %> LIMIT <%= limit %>)" var query = "DELETE FROM <%= table %> WHERE <%= primaryKeys %> IN (SELECT <%= primaryKeysSelection %> FROM <%= table %> WHERE <%= where %> LIMIT <%= limit %>)"
var pks; var pks;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!