@@ -1056,28 +1056,25 @@ export class PostgresStorageAdapter implements StorageAdapter {
10561056 conn = conn || this . _client ;
10571057 const self = this ;
10581058
1059- await conn . tx ( 'schema-upgrade' , async t => {
1059+ await conn . task ( 'schema-upgrade' , async t => {
10601060 const columns = await t . map (
10611061 'SELECT column_name FROM information_schema.columns WHERE table_name = $<className>' ,
10621062 { className } ,
10631063 a => a . column_name
10641064 ) ;
10651065 const newColumns = Object . keys ( schema . fields )
10661066 . filter ( item => columns . indexOf ( item ) === - 1 )
1067- . map ( fieldName =>
1068- self . addFieldIfNotExists ( className , fieldName , schema . fields [ fieldName ] , t )
1069- ) ;
1067+ . map ( fieldName => self . addFieldIfNotExists ( className , fieldName , schema . fields [ fieldName ] ) ) ;
10701068
10711069 await t . batch ( newColumns ) ;
10721070 } ) ;
10731071 }
10741072
1075- async addFieldIfNotExists ( className : string , fieldName : string , type : any , conn : any ) {
1073+ async addFieldIfNotExists ( className : string , fieldName : string , type : any ) {
10761074 // TODO: Must be revised for invalid logic...
10771075 debug ( 'addFieldIfNotExists' ) ;
1078- conn = conn || this . _client ;
10791076 const self = this ;
1080- await conn . tx ( 'add-field-if-not-exists' , async t => {
1077+ await this . _client . tx ( 'add-field-if-not-exists' , async t => {
10811078 if ( type . type !== 'Relation' ) {
10821079 try {
10831080 await t . none (
0 commit comments