Skip to content

Commit ac42142

Browse files
committed
Merge branch 'master' into fixSelectExclude
2 parents 51874b5 + 755c494 commit ac42142

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"mustache": "4.2.0",
5050
"parse": "3.1.0",
5151
"pg-monitor": "1.4.1",
52-
"pg-promise": "10.9.2",
52+
"pg-promise": "10.10.1",
5353
"pluralize": "8.0.0",
5454
"redis": "3.1.1",
5555
"semver": "7.3.4",

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)