File tree 1 file changed +6
-8
lines changed
src/Adapters/Storage/Postgres 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -564,14 +564,12 @@ export class PostgresStorageAdapter {
564
564
// Drops a collection. Resolves with true if it was a Parse Schema (eg. _User, Custom, etc.)
565
565
// and resolves with false if it wasn't (eg. a join table). Rejects if deletion was impossible.
566
566
deleteClass ( className ) {
567
- return Promise . resolve ( ) . then ( ( ) => {
568
- const operations = [ [ `DROP TABLE IF EXISTS $1:name` , [ className ] ] ,
569
- [ `DELETE FROM "_SCHEMA" WHERE "className"=$1` , [ className ] ] ] ;
570
- return this . _client . tx ( t => t . batch ( operations . map ( statement => t . none ( statement [ 0 ] , statement [ 1 ] ) ) ) ) ;
571
- } ) . then ( ( ) => {
572
- // resolves with false when _Join table
573
- return className . indexOf ( '_Join:' ) != 0 ;
574
- } ) ;
567
+ const operations = [
568
+ { query : `DROP TABLE IF EXISTS $1:name` , values : [ className ] } ,
569
+ { query : `DELETE FROM "_SCHEMA" WHERE "className" = $1` , values : [ className ] }
570
+ ] ;
571
+ return this . _client . tx ( t => t . none ( this . _pgp . helpers . concat ( operations ) ) )
572
+ . then ( ( ) => className . indexOf ( '_Join:' ) != 0 ) ; // resolves with false when _Join table
575
573
}
576
574
577
575
// Delete all data known to this adapter. Used for testing.
You can’t perform that action at this time.
0 commit comments