@@ -723,15 +723,15 @@ export class PostgresStorageAdapter {
723723 } ) ;
724724 const qs = `CREATE TABLE IF NOT EXISTS $1:name (${ patternsArray . join ( ) } )` ;
725725 const values = [ className , ...valuesArray ] ;
726-
726+
727727 return conn . task ( 'create-table' , function * ( t ) {
728728 try {
729729 yield self . _ensureSchemaCollectionExists ( t ) ;
730730 yield t . none ( qs , values ) ;
731731 } catch ( error ) {
732- if ( error . code !== PostgresDuplicateRelationError ) {
733- throw error ;
734- }
732+ if ( error . code !== PostgresDuplicateRelationError ) {
733+ throw error ;
734+ }
735735 // ELSE: Table already exists, must have been created by a different request. Ignore the error.
736736 }
737737 yield t . tx ( 'create-table-tx' , tx => {
@@ -755,14 +755,14 @@ export class PostgresStorageAdapter {
755755 postgresType : parseTypeToPostgresType ( type )
756756 } ) ;
757757 } catch ( error ) {
758- if ( error . code === PostgresRelationDoesNotExistError ) {
759- return yield self . createClass ( className , { fields : { [ fieldName ] : type } } , t ) ;
760- }
761- if ( error . code !== PostgresDuplicateColumnError ) {
762- throw error ;
763- }
764- // Column already exists, created by other request. Carry on to see if it's the right type.
765- } ;
758+ if ( error . code === PostgresRelationDoesNotExistError ) {
759+ return yield self . createClass ( className , { fields : { [ fieldName ] : type } } , t ) ;
760+ }
761+ if ( error . code !== PostgresDuplicateColumnError ) {
762+ throw error ;
763+ }
764+ // Column already exists, created by other request. Carry on to see if it's the right type.
765+ }
766766 } else {
767767 yield t . none ( 'CREATE TABLE IF NOT EXISTS $<joinTable:name> ("relatedId" varChar(120), "owningId" varChar(120), PRIMARY KEY("relatedId", "owningId") )' , { joinTable : `_Join:${ fieldName } :${ className } ` } ) ;
768768 }
@@ -794,7 +794,7 @@ export class PostgresStorageAdapter {
794794 const now = new Date ( ) . getTime ( ) ;
795795 const helpers = this . _pgp . helpers ;
796796 debug ( 'deleteAllClasses' ) ;
797-
797+
798798 return this . _client . task ( 'delete-all-classes' , function * ( t ) {
799799 try {
800800 const results = yield t . any ( 'SELECT * FROM "_SCHEMA"' ) ;
@@ -811,8 +811,8 @@ export class PostgresStorageAdapter {
811811 // No _SCHEMA collection. Don't delete anything.
812812 }
813813 } ) . then ( ( ) => {
814- debug ( `deleteAllClasses done in ${ new Date ( ) . getTime ( ) - now } ` ) ;
815- } ) ;
814+ debug ( `deleteAllClasses done in ${ new Date ( ) . getTime ( ) - now } ` ) ;
815+ } ) ;
816816 }
817817
818818 // Remove the column and all the data. For Relations, the _Join collection is handled
@@ -860,7 +860,7 @@ export class PostgresStorageAdapter {
860860 return this . _client . task ( 'get-all-classes' , function * ( t ) {
861861 yield self . _ensureSchemaCollectionExists ( t ) ;
862862 return yield t . map ( 'SELECT * FROM "_SCHEMA"' , null , row => toParseSchema ( { className : row . className , ...row . schema } ) ) ;
863- } ) ;
863+ } ) ;
864864 }
865865
866866 // Return a promise for the schema with the given name, in Parse format. If
@@ -1500,7 +1500,6 @@ export class PostgresStorageAdapter {
15001500 columns . push ( `AVG(${ transformAggregateField ( value . $avg ) } ) AS "${ field } "` ) ;
15011501 }
15021502 }
1503- columns . join ( ) ;
15041503 } else {
15051504 columns . push ( '*' ) ;
15061505 }
@@ -1546,7 +1545,7 @@ export class PostgresStorageAdapter {
15461545 }
15471546 }
15481547
1549- const qs = `SELECT ${ columns } FROM $1:name ${ wherePattern } ${ sortPattern } ${ limitPattern } ${ skipPattern } ${ groupPattern } ` ;
1548+ const qs = `SELECT ${ columns . join ( ) } FROM $1:name ${ wherePattern } ${ sortPattern } ${ limitPattern } ${ skipPattern } ${ groupPattern } ` ;
15501549 debug ( qs , values ) ;
15511550 return this . _client . map ( qs , values , a => this . postgresObjectToParseObject ( className , a , schema ) )
15521551 . then ( results => {
0 commit comments