From 82cd27520b9d8db1ed9d4e720ac84d31c9a3f371 Mon Sep 17 00:00:00 2001 From: Vitaly Tomilov Date: Fri, 30 Oct 2020 15:58:53 +0000 Subject: [PATCH] Update PostgresStorageAdapter.js (#6981) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update PostgresStorageAdapter.js Start moving toward better, ES7 syntax. * Update PostgresStorageAdapter.js Fixing spaces 🤦‍♂️ --- .../Postgres/PostgresStorageAdapter.js | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js index 3ca9cd43..ada6c51a 100644 --- a/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js +++ b/src/Adapters/Storage/Postgres/PostgresStorageAdapter.js @@ -2463,20 +2463,19 @@ export class PostgresStorageAdapter implements StorageAdapter { }); return Promise.all(promises) .then(() => { - return this._client.tx('perform-initialization', t => { - return t.batch([ - t.none(sql.misc.jsonObjectSetKeys), - t.none(sql.array.add), - t.none(sql.array.addUnique), - t.none(sql.array.remove), - t.none(sql.array.containsAll), - t.none(sql.array.containsAllRegex), - t.none(sql.array.contains), - ]); + return this._client.tx('perform-initialization', async t => { + await t.none(sql.misc.jsonObjectSetKeys); + await t.none(sql.array.add); + await t.none(sql.array.addUnique); + await t.none(sql.array.remove); + await t.none(sql.array.containsAll); + await t.none(sql.array.containsAllRegex); + await t.none(sql.array.contains); + return t.ctx; }); }) - .then(data => { - debug(`initializationDone in ${data.duration}`); + .then(ctx => { + debug(`initializationDone in ${ctx.duration}`); }) .catch(error => { /* eslint-disable no-console */