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

Commit cbd13ea7 by smihica

Fixed a bug that wrong sql generated when deleting object that has a specific fi…

…eld as a primary key in postgres.
1 parent 364e601d
Showing with 3 additions and 1 deletions
...@@ -395,7 +395,9 @@ var QueryGenerator = { ...@@ -395,7 +395,9 @@ var QueryGenerator = {
primaryKeys[tableName] = primaryKeys[tableName] || []; primaryKeys[tableName] = primaryKeys[tableName] || [];
if (!!model && primaryKeys[tableName].length < 1) { if (!!model && primaryKeys[tableName].length < 1) {
primaryKeys[tableName] = Object.keys(model.primaryKeys); primaryKeys[tableName] = Utils._.map(Object.keys(model.primaryKeys), function(k){
return model.primaryKeys[k].field;
});
} }
if (options.limit) { if (options.limit) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!