File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed
Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ const g = require('strong-globalize')();
99module . exports = mixinDiscovery ;
1010
1111function mixinDiscovery ( PostgreSQL ) {
12- const async = require ( 'async' ) ;
13-
1412 PostgreSQL . prototype . paginateSQL = function ( sql , orderBy , options ) {
1513 options = options || { } ;
1614 let limit = '' ;
Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ module.exports = mixinMigration;
1414
1515function 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' :
You can’t perform that action at this time.
0 commit comments