diff --git a/lib/discovery.js b/lib/discovery.js index a10454d7..1d234fa5 100644 --- a/lib/discovery.js +++ b/lib/discovery.js @@ -20,7 +20,7 @@ function mixinDiscovery(PostgreSQL) { limit = limit + ' LIMIT ' + options.limit; } } - if (!orderBy) { + if (orderBy) { sql += ' ORDER BY ' + orderBy; } return sql + limit;