Skip to content

Commit 167ed0b

Browse files
committed
chore: remove redundant code
Signed-off-by: Francisco Buceta <frbuceta@gmail.com>
1 parent 672b0aa commit 167ed0b

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

lib/discovery.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const g = require('strong-globalize')();
99
module.exports = mixinDiscovery;
1010

1111
function mixinDiscovery(PostgreSQL) {
12-
const async = require('async');
13-
1412
PostgreSQL.prototype.paginateSQL = function(sql, orderBy, options) {
1513
options = options || {};
1614
let limit = '';

lib/migration.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ module.exports = mixinMigration;
1414

1515
function mixinMigration(PostgreSQL) {
1616
PostgreSQL.prototype.checkFieldAndIndex = function(fields, indexes) {
17-
if (fields && indexes)
18-
return true;
19-
return false;
17+
return !!(fields && indexes);
2018
};
2119

2220
PostgreSQL.prototype.showFields = function(model, cb) {
@@ -223,11 +221,10 @@ function mixinMigration(PostgreSQL) {
223221

224222
PostgreSQL.prototype.modifyDatatypeInActual = function(model, propName) {
225223
const self = this;
226-
const sqlCommand = self.columnEscaped(model, propName) + ' TYPE ' +
224+
return self.columnEscaped(model, propName) + ' TYPE ' +
227225
self.columnDataType(model, propName) + ' USING ' +
228226
self.columnEscaped(model, propName) + '::' +
229227
self.columnDataType(model, propName);
230-
return sqlCommand;
231228
};
232229

233230
PostgreSQL.prototype.modifyNullabilityInActual = function(model, propName) {
@@ -519,8 +516,7 @@ function mixinMigration(PostgreSQL) {
519516
};
520517

521518
PostgreSQL.prototype.buildColumnType = function buildColumnType(propertyDefinition) {
522-
const p = propertyDefinition;
523-
switch (p.type.name) {
519+
switch (propertyDefinition.type.name) {
524520
default:
525521
case 'String':
526522
case 'JSON':

0 commit comments

Comments
 (0)