Lets increment/set badges on all _Installations (#3970)

* Lets increment/set badges on all _Installations

* Makes sure PG update where query is properly formed with empty query
This commit is contained in:
Florent Vilmart
2017-07-03 10:16:04 -04:00
committed by GitHub
parent 5931aa8851
commit ad52ed64af
4 changed files with 9 additions and 19 deletions

View File

@@ -1091,7 +1091,8 @@ export class PostgresStorageAdapter {
const where = buildWhereClause({ schema, index, query })
values.push(...where.values);
const qs = `UPDATE $1:name SET ${updatePatterns.join(',')} WHERE ${where.pattern} RETURNING *`;
const whereClause = where.pattern.length > 0 ? `WHERE ${where.pattern}` : '';
const qs = `UPDATE $1:name SET ${updatePatterns.join(',')} ${whereClause} RETURNING *`;
debug('update: ', qs, values);
return this._client.any(qs, values);
}