@payloadcms/db-postgres 0.1.0-beta.17 → 0.1.0-beta.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAW/C,eAAO,MAAM,OAAO,EAAE,OA0FrB,CAAA"}
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAW/C,eAAO,MAAM,OAAO,EAAE,OA+FrB,CAAA"}
package/dist/connect.js CHANGED
@@ -42,7 +42,7 @@ const connect = async function connect(payload) {
42
42
  process.exit(1);
43
43
  }
44
44
  // Only push schema if not in production
45
- if (process.env.NODE_ENV === 'production' || process.env.PAYLOAD_MIGRATING === 'true') return;
45
+ if (process.env.NODE_ENV === 'production' || process.env.PAYLOAD_MIGRATING === 'true' || this.push === false) return;
46
46
  // This will prompt if clarifications are needed for Drizzle to push new schema
47
47
  const { apply, hasDataLoss, statementsToExecute, warnings } = await (0, _utils.pushSchema)(this.schema, this.drizzle);
48
48
  if (warnings.length) {
@@ -88,4 +88,4 @@ const connect = async function connect(payload) {
88
88
  }
89
89
  };
90
90
 
91
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb25uZWN0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ29ubmVjdCB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCB7IHB1c2hTY2hlbWEgfSBmcm9tICdkcml6emxlLWtpdC91dGlscydcbmltcG9ydCB7IGVxLCBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB7IGRyaXp6bGUgfSBmcm9tICdkcml6emxlLW9ybS9ub2RlL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[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAmB,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAmC3E,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,qBAAqB,CA0DjE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAmB,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAmC3E,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,qBAAqB,CA2DjE"}
package/dist/index.js CHANGED
@@ -59,6 +59,7 @@ function postgresAdapter(args) {
59
59
  enums: {},
60
60
  pool: undefined,
61
61
  poolOptions: args.pool,
62
+ push: args.push,
62
63
  relations: {},
63
64
  schema: {},
64
65
  sessions: {},
@@ -102,4 +103,4 @@ function postgresAdapter(args) {
102
103
  return adapter;
103
104
  }
104
105
 
105
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFBheWxvYWQgfSBmcm9tICdwYXlsb2FkJ1xuXG5pbXBvcnQgcGF0aCBmcm9tICdwYXRoJ1xuaW1wb3J0IHsgY3JlYXRlRGF0YWJhc2VBZGFwdGVyIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcblxuaW1wb3J0IHR5cGUgeyBBcmdzLCBQb3N0Z3Jlc0FkYXB0ZXIsIFBvc3RncmVzQWRhcHRlclJlc3VsdCB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IGNvbm5lY3QgfSBmcm9tICcuL2Nvbm5lY3QnXG5pbXBvcnQgeyBjcmVhdG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ASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,wBAAsB,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DlE"}
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAM9C,wBAAsB,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DlE"}
package/dist/migrate.js CHANGED
@@ -10,10 +10,10 @@ Object.defineProperty(exports, "migrate", {
10
10
  });
11
11
  const _utils = require("drizzle-kit/utils");
12
12
  const _database = require("payload/database");
13
- const _pg = require("pg");
14
13
  const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
15
14
  const _createMigrationTable = require("./utilities/createMigrationTable");
16
15
  const _migrationTableExists = require("./utilities/migrationTableExists");
16
+ const _parseError = require("./utilities/parseError");
17
17
  function _interop_require_default(obj) {
18
18
  return obj && obj.__esModule ? obj : {
19
19
  default: obj
@@ -94,17 +94,11 @@ async function runMigrationFile(payload, migration, batch) {
94
94
  }
95
95
  });
96
96
  } catch (err) {
97
- let msg = `Error running migration ${migration.name}`;
98
- if (err instanceof _pg.DatabaseError) {
99
- msg += `: ${err.message}`;
100
- if (err.hint) msg += `. ${err.hint}`;
101
- }
102
97
  payload.logger.error({
103
98
  err,
104
- msg
99
+ msg: (0, _parseError.parseError)(err, `Error running migration ${migration.name}`)
105
100
  });
106
- throw err;
107
101
  }
108
102
  }
109
103
 
110
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXJlc3RyaWN0ZWQtc3ludGF4LCBuby1hd2FpdC1pbi1sb29wICovXG5pbXBvcnQg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RQUFRRjtZQUNWO1FBQ0Y7SUFDRixFQUFFLE9BQU9NLEtBQWM7UUFDckIvQyxRQUFRSSxNQUFNLENBQUM0QyxLQUFLLENBQUM7WUFDbkJEO1lBQ0F6QyxLQUFLMkMsSUFBQUEsc0JBQVUsRUFBQ0YsS0FBSyxDQUFDLHdCQUF3QixFQUFFZixVQUFVUixJQUFJLENBQUMsQ0FBQztRQUNsRTtJQUNGO0FBQ0YifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"migrateDown.d.ts","sourceRoot":"","sources":["../src/migrateDown.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DtE"}
1
+ {"version":3,"file":"migrateDown.d.ts","sourceRoot":"","sources":["../src/migrateDown.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,wBAAsB,WAAW,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwDtE"}
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "migrateDown", {
10
10
  });
11
11
  const _database = require("payload/database");
12
12
  const _migrationTableExists = require("./utilities/migrationTableExists");
13
+ const _parseError = require("./utilities/parseError");
13
14
  async function migrateDown() {
14
15
  const { payload } = this;
15
16
  const migrationFiles = await (0, _database.readMigrationFiles)({
@@ -18,17 +19,16 @@ async function migrateDown() {
18
19
  const { existingMigrations, latestBatch } = await (0, _database.getMigrations)({
19
20
  payload
20
21
  });
21
- const migrationsToRollback = existingMigrations.filter((migration)=>migration.batch === latestBatch && migration.batch !== -1);
22
- if (!migrationsToRollback?.length) {
22
+ if (!existingMigrations?.length) {
23
23
  payload.logger.info({
24
24
  msg: 'No migrations to rollback.'
25
25
  });
26
26
  return;
27
27
  }
28
28
  payload.logger.info({
29
- msg: `Rolling back batch ${latestBatch} consisting of ${migrationsToRollback.length} migration(s).`
29
+ msg: `Rolling back batch ${latestBatch} consisting of ${existingMigrations.length} migration(s).`
30
30
  });
31
- for (const migration of migrationsToRollback){
31
+ for (const migration of existingMigrations){
32
32
  const migrationFile = migrationFiles.find((m)=>m.name === migration.name);
33
33
  if (!migrationFile) {
34
34
  throw new Error(`Migration ${migration.name} not found locally.`);
@@ -61,11 +61,11 @@ async function migrateDown() {
61
61
  await this.rollbackTransaction(transactionID);
62
62
  payload.logger.error({
63
63
  err,
64
- msg: `Error running migration ${migrationFile.name}`
64
+ msg: (0, _parseError.parseError)(err, `Error migrating down ${migrationFile.name}. Rolling back.`)
65
65
  });
66
- throw err;
66
+ process.exit(1);
67
67
  }
68
68
  }
69
69
  }
70
70
 
71
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlRG93bi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBuby1yZXN0cmljdGVkLXN5bnRheCwgbm8tYXdhaXQtaW4tbG9vcCAqL1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IGdldE1pZ3JhdGlvbnMsIHJlYWRNaWdyYXRpb25GaWxlcyB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuaW1wb3J0IHsgbWlncmF0aW9uVGFibGVFeGlzdHMgfSBmcm9tICcuL3V0aWxpdGllcy9taWdyYXRpb25UYWJsZUV4aXN0cydcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIG1pZ3JhdGVEb3duKHRoaXM6IFBvc3RncmVzQWRhcHRlcik6IFByb21pc2U8dm9pZD4ge1xuICBjb25zdCB7IHBheWxvY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O2dCQUNsQkMsS0FBSyxDQUFDLGdCQUFnQixFQUFFRSxjQUFjRyxJQUFJLENBQUMsRUFBRSxFQUFFRyxLQUFLQyxHQUFHLEtBQUtGLE1BQU0sR0FBRyxDQUFDO1lBQ3hFO1lBRUEsTUFBTU0sY0FBYyxNQUFNQyxJQUFBQSwwQ0FBb0IsRUFBQyxJQUFJLENBQUNDLE9BQU87WUFDM0QsSUFBSUYsYUFBYTtnQkFDZixNQUFNdEIsUUFBUXlCLE1BQU0sQ0FBQztvQkFDbkJDLElBQUloQixVQUFVZ0IsRUFBRTtvQkFDaEJDLFlBQVk7b0JBQ1pDLEtBQUs7d0JBQ0hUO29CQUNGO2dCQUNGO1lBQ0Y7WUFFQSxNQUFNLElBQUksQ0FBQ1UsaUJBQWlCLENBQUNWO1FBQy9CLEVBQUUsT0FBT1csS0FBYztZQUNyQixNQUFNLElBQUksQ0FBQ0MsbUJBQW1CLENBQUNaO1lBRS9CbkIsUUFBUU8sTUFBTSxDQUFDeUIsS0FBSyxDQUFDO2dCQUNuQkY7Z0JBQ0FyQixLQUFLd0IsSUFBQUEsc0JBQVUsRUFBQ0gsS0FBSyxDQUFDLHFCQUFxQixFQUFFbkIsY0FBY0csSUFBSSxDQUFDLGVBQWUsQ0FBQztZQUNsRjtZQUNBb0IsUUFBUUMsSUFBSSxDQUFDO1FBQ2Y7SUFDRjtBQUNGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"migrateFresh.d.ts","sourceRoot":"","sources":["../src/migrateFresh.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DvE"}
1
+ {"version":3,"file":"migrateFresh.d.ts","sourceRoot":"","sources":["../src/migrateFresh.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA6DvE"}
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "migrateFresh", {
11
11
  const _drizzleorm = require("drizzle-orm");
12
12
  const _database = require("payload/database");
13
13
  const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
14
+ const _parseError = require("./utilities/parseError");
14
15
  function _interop_require_default(obj) {
15
16
  return obj && obj.__esModule ? obj : {
16
17
  default: obj
@@ -71,11 +72,10 @@ async function migrateFresh() {
71
72
  await this.rollbackTransaction(transactionID);
72
73
  payload.logger.error({
73
74
  err,
74
- msg: `Error running migration ${migration.name}. Rolling back.`
75
+ msg: (0, _parseError.parseError)(err, `Error running migration ${migration.name}. Rolling back`)
75
76
  });
76
- throw err;
77
77
  }
78
78
  }
79
79
  }
80
80
 
81
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlRnJlc2gudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IHNxbCB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHsgcmVhZE1pZ3JhdGlvbkZpbGVzIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuLyoqXG4gKiBEcm9wIHRoZSBjdXJyZW50IGRhdGFiYXNlIGFuZCBydW4gYWxsIG1pZ3JhdGUgdXAgZnVuY3Rpb25zXG4gKi9cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBtaWdyYXRlRnJlc2godGhpczogUG9zdGd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FFb0IsS0FBS0MsR0FBRyxLQUFLRixNQUFNLEdBQUcsQ0FBQztZQUFDO1FBQ3RGLEVBQUUsT0FBT1csS0FBYztZQUNyQixNQUFNLElBQUksQ0FBQ0MsbUJBQW1CLENBQUNkO1lBQy9CckIsUUFBUVcsTUFBTSxDQUFDeUIsS0FBSyxDQUFDO2dCQUNuQkY7Z0JBQ0FyQixLQUFLd0IsSUFBQUEsc0JBQVUsRUFBQ0gsS0FBSyxDQUFDLHdCQUF3QixFQUFFWixVQUFVbEIsSUFBSSxDQUFDLGNBQWMsQ0FBQztZQUNoRjtRQUNGO0lBQ0Y7QUFDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"migrateRefresh.d.ts","sourceRoot":"","sources":["../src/migrateRefresh.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,iBAkGzD"}
1
+ {"version":3,"file":"migrateRefresh.d.ts","sourceRoot":"","sources":["../src/migrateRefresh.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,iBAyFzD"}
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "migrateRefresh", {
10
10
  });
11
11
  const _database = require("payload/database");
12
12
  const _migrationTableExists = require("./utilities/migrationTableExists");
13
+ const _parseError = require("./utilities/parseError");
13
14
  async function migrateRefresh() {
14
15
  const { payload } = this;
15
16
  const migrationFiles = await (0, _database.readMigrationFiles)({
@@ -18,20 +19,19 @@ async function migrateRefresh() {
18
19
  const { existingMigrations, latestBatch } = await (0, _database.getMigrations)({
19
20
  payload
20
21
  });
21
- const migrationsToRollback = existingMigrations.filter((migration)=>migration.batch === latestBatch && migration.batch !== -1);
22
- if (!migrationsToRollback?.length) {
22
+ if (!existingMigrations?.length) {
23
23
  payload.logger.info({
24
24
  msg: 'No migrations to rollback.'
25
25
  });
26
26
  return;
27
27
  }
28
28
  payload.logger.info({
29
- msg: `Rolling back batch ${latestBatch} consisting of ${migrationsToRollback.length} migration(s).`
29
+ msg: `Rolling back batch ${latestBatch} consisting of ${existingMigrations.length} migration(s).`
30
30
  });
31
31
  let transactionID;
32
32
  // Reverse order of migrations to rollback
33
- migrationsToRollback.reverse();
34
- for (const migration of migrationsToRollback){
33
+ existingMigrations.reverse();
34
+ for (const migration of existingMigrations){
35
35
  try {
36
36
  const migrationFile = migrationFiles.find((m)=>m.name === migration.name);
37
37
  if (!migrationFile) {
@@ -64,15 +64,11 @@ async function migrateRefresh() {
64
64
  }
65
65
  } catch (err) {
66
66
  await this.rollbackTransaction(transactionID);
67
- let msg = `Error running migration ${migration.name}. Rolling back.`;
68
- if (err instanceof Error) {
69
- msg += ` ${err.message}`;
70
- }
71
67
  payload.logger.error({
72
68
  err,
73
- msg
69
+ msg: (0, _parseError.parseError)(err, `Error running migration ${migration.name}. Rolling back.`)
74
70
  });
75
- throw err;
71
+ process.exit(1);
76
72
  }
77
73
  }
78
74
  // Run all migrate up
@@ -104,11 +100,10 @@ async function migrateRefresh() {
104
100
  await this.rollbackTransaction(transactionID);
105
101
  payload.logger.error({
106
102
  err,
107
- msg: `Error running migration ${migration.name}. Rolling back.`
103
+ msg: (0, _parseError.parseError)(err, `Error running migration ${migration.name}. Rolling back.`)
108
104
  });
109
- throw err;
110
105
  }
111
106
  }
112
107
  }
113
108
 
114
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlUmVmcmVzaC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKiBlc2xpbnQtZGlzYWJsZSBuby1yZXN0cmljdGVkLXN5bnRheCwgbm8tYXdhaXQtaW4tbG9vcCAqL1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCB9IGZyb20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UFBQUEsc0JBQVUsRUFBQ0gsS0FBSyxDQUFDLHdCQUF3QixFQUFFbkIsVUFBVUksSUFBSSxDQUFDLGVBQWUsQ0FBQztZQUNqRjtRQUNGO0lBQ0Y7QUFDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"migrateReset.d.ts","sourceRoot":"","sources":["../src/migrateReset.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEvE"}
1
+ {"version":3,"file":"migrateReset.d.ts","sourceRoot":"","sources":["../src/migrateReset.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwEvE"}
@@ -26,13 +26,13 @@ async function migrateReset() {
26
26
  }
27
27
  // Rollback all migrations in order
28
28
  for (const migration of existingMigrations){
29
- const migrationFile = migrationFiles.find((m)=>m.name === migration.name);
30
- if (!migrationFile) {
31
- throw new Error(`Migration ${migration.name} not found locally.`);
32
- }
33
- const start = Date.now();
34
29
  let transactionID;
30
+ const migrationFile = migrationFiles.find((m)=>m.name === migration.name);
35
31
  try {
32
+ if (!migrationFile) {
33
+ throw new Error(`Migration ${migration.name} not found locally.`);
34
+ }
35
+ const start = Date.now();
36
36
  payload.logger.info({
37
37
  msg: `Migrating down: ${migrationFile.name}`
38
38
  });
@@ -55,12 +55,14 @@ async function migrateReset() {
55
55
  }
56
56
  await this.commitTransaction(transactionID);
57
57
  } catch (err) {
58
+ let msg = `Error running migration ${migrationFile.name}.`;
59
+ if (err instanceof Error) msg += ` ${err.message}`;
58
60
  await this.rollbackTransaction(transactionID);
59
61
  payload.logger.error({
60
62
  err,
61
- msg: `Error running migration ${migrationFile.name}`
63
+ msg
62
64
  });
63
- throw err;
65
+ process.exit(1);
64
66
  }
65
67
  }
66
68
  // Delete dev migration
@@ -84,4 +86,4 @@ async function migrateReset() {
84
86
  }
85
87
  }
86
88
 
87
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlUmVzZXQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcmVzdHJpY3RlZC1zeW50YXgsIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBnZXRNaWdyYXRpb25zLCByZWFkTWlncmF0aW9uRmlsZXMgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IG1pZ3JhdGlvblRhYmxlRXhpc3RzIH0gZnJvbSAnLi91dGlsaXRpZXMvbWlncmF0aW9uVGFibGVFeGlzdHMnXG5cbi8qKlxuICogUnVuIGFsbCBtaWdyYXRlIGRvd24gZnVuY3Rpb25zXG4gKi9cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBtaWdyYXRlUmVzZXQodGhpczogUG9zdGdyZXNBZGFwdGVyKTogUHJvbWlzZTx2b2lkPiB7XG4gIGNvbnN0IHsgcGF5bG9hZCB9ID0gdGhpc1xuICBjb25zdCBtaWdyYXRpb25GaWxlcyA9IGF3YWl0IHJlYWRNaWdyYXRpb25GaWxlcyh7IHBheWxvYWQgfSlcblxuICBjb25zdCB7IGV4aXN0aW5nTWlncmF0aW9ucyB9ID0gYXdhaXQgZ2V0TWlncmF0aW9ucyh7IHBheWxvYWQgfSlcblxuICBpZiAoIWV4aXN0aW5nTWlncmF0aW9ucz8ubGVuZ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3B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,UAAU,6LAapB,IAAI,KAAG,MA6QT,CAAA"}
@@ -180,12 +180,13 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildRela
180
180
  });
181
181
  const relationshipsTableName = `${tableName}_rels`;
182
182
  relationshipsTable = (0, _pgcore.pgTable)(relationshipsTableName, relationshipColumns, (cols)=>{
183
- const result = {};
183
+ const result = {
184
+ order: (0, _pgcore.index)('order_idx').on(cols.order),
185
+ parentIdx: (0, _pgcore.index)('parent_idx').on(cols.parent),
186
+ pathIdx: (0, _pgcore.index)('path_idx').on(cols.path)
187
+ };
184
188
  if (hasLocalizedRelationshipField) {
185
189
  result.localeIdx = (0, _pgcore.index)('locale_idx').on(cols.locale);
186
- result.parentPathOrderLocale = (0, _pgcore.unique)(`${relationshipsTableName}_unique`).on(cols.parent, cols.path, cols.order, cols.locale);
187
- } else {
188
- result.parentPathOrder = (0, _pgcore.unique)(`${relationshipsTableName}_unique`).on(cols.parent, cols.path, cols.order);
189
190
  }
190
191
  return result;
191
192
  });
@@ -243,4 +244,4 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildRela
243
244
  };
244
245
  };
245
246
 
246
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvYnVpbGQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgUmVsYXRpb24gfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB0eXB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uICAgICAgICAgICAgY29scy5vcmRlcixcbiAgICAgICAgICAgIGNvbHMubG9jYWxlLFxuICAgICAgICAgIClcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXN1bHQucGFyZW50UGF0aE9yZGVyID0gdW5pcXVlKGAke3JlbGF0aW9uc2hpcHNUYWJsZU5hbWV9X3VuaXF1ZWApLm9uKFxuICAgICAgICAgICAgY29scy5wYXJlbnQsXG4gICAgICAgICAgICBjb2xzLnBhdGgsXG4gICAgICAgICAgICBjb2xzLm9yZGVyLFxuICAgICAgICAgIClcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgIH0pXG5cbiAgICAgIGFkYXB0ZXIudGFibGVzW3JlbGF0aW9uc2hpcHNUYWJsZU5hbWVdID0gcmVsYXRpb25zaGlwc1RhYmxlXG5cbiAgICAgIGNvbnN0IHJlbGF0aW9uc2hpcHNUYWJsZVJlbGF0aW9ucyA9IHJlbGF0aW9ucyhyZWxhdGlvbnNoaXBzVGFibGUsICh7IG9uZSB9KSA9PiB7XG4gICAgICAgIGNvbnN0IHJlc3VsdDogUmVjb3JkPHN0cmluZywgUmVsYXRpb248c3RyaW5nPj4gPSB7XG4gICAgICAgICAgcGFyZW50OiBvbmUodGFibGUsIHtcbiAgICAgICAgICAgIGZpZWxkczogW3JlbGF0aW9uc2hpcHNUYWJsZS5wYXJlbnRdLFxuICAgICAgICAgICAgcmVmZXJlbmNlczogW3RhYmxlLmlkXSxcbiAgICAgICAgICAgIHJlbGF0aW9uTmFtZTogJ19yZWxzJyxcbiAgICAgICAgICB9KSxcbiAgICAgICAgfVxuXG4gICAgICAgIHJlbGF0aW9uc2hpcHMuZm9yRWFjaCgocmVsYXRpb25UbykgPT4ge1xuICAgICAgICAgIGNvbnN0IHJlbGF0ZWRUYWJsZU5hbWUgPSB0b1NuYWtlQ2FzZShyZWxhdGlvblRvKVxuICAgICAgICAgIGNvbnN0IGlkQ29sdW1uTmFtZSA9IGAke3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ACtE,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,iBAAiB,EAAE,OAAO,CAAA;IAC1B,2BAA2B,EAAE,OAAO,CAAA;IACpC,6BAA6B,EAAE,OAAO,CAAA;IACtC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,cAAc,qSAoBxB,IAAI,KAAG,MAmfT,CAAA"}
@@ -140,13 +140,13 @@ const traverseFields = ({ adapter, buildRelationships, collectionIndexes, column
140
140
  }).notNull(),
141
141
  value: adapter.enums[enumName]('value')
142
142
  };
143
- const baseExtraConfig = {};
143
+ const baseExtraConfig = {
144
+ orderIdx: (cols)=>(0, _pgcore.index)('order_idx').on(cols.order),
145
+ parentIdx: (cols)=>(0, _pgcore.index)('parent_idx').on(cols.parent)
146
+ };
144
147
  if (field.localized) {
145
148
  baseColumns.locale = adapter.enums.enum__locales('locale').notNull();
146
- baseExtraConfig.parentOrderLocale = (cols)=>(0, _pgcore.unique)(`${selectTableName}_unique`).on(cols.parent, cols.order, cols.locale);
147
- } else {
148
- baseExtraConfig.parent = (cols)=>(0, _pgcore.index)('parent_idx').on(cols.parent);
149
- baseExtraConfig.order = (cols)=>(0, _pgcore.index)('order_idx').on(cols.order);
149
+ baseExtraConfig.localeIdx = (cols)=>(0, _pgcore.index)('locale_idx').on(cols.locale);
150
150
  }
151
151
  if (field.index) {
152
152
  baseExtraConfig.value = (cols)=>(0, _pgcore.index)('value_idx').on(cols.value);
@@ -193,12 +193,13 @@ const traverseFields = ({ adapter, buildRelationships, collectionIndexes, column
193
193
  onDelete: 'cascade'
194
194
  }).notNull()
195
195
  };
196
- const baseExtraConfig = {};
196
+ const baseExtraConfig = {
197
+ _orderIdx: (cols)=>(0, _pgcore.index)('_order_idx').on(cols._order),
198
+ _parentIDIdx: (cols)=>(0, _pgcore.index)('_parent_id_idx').on(cols._parentID)
199
+ };
197
200
  if (field.localized && adapter.payload.config.localization) {
198
201
  baseColumns._locale = adapter.enums.enum__locales('_locale').notNull();
199
- baseExtraConfig._parentOrderLocale = (cols)=>(0, _pgcore.unique)(`${arrayTableName}_unique`).on(cols._parentID, cols._order, cols._locale);
200
- } else {
201
- baseExtraConfig._parentOrder = (cols)=>(0, _pgcore.unique)(`${arrayTableName}_unique`).on(cols._parentID, cols._order);
202
+ baseExtraConfig._localeIdx = (cols)=>(0, _pgcore.index)('_locale_idx').on(cols._locale);
202
203
  }
203
204
  const { relationsToBuild: subRelationsToBuild } = (0, _build.buildTable)({
204
205
  adapter,
@@ -246,12 +247,14 @@ const traverseFields = ({ adapter, buildRelationships, collectionIndexes, column
246
247
  }).notNull(),
247
248
  _path: (0, _pgcore.text)('_path').notNull()
248
249
  };
249
- const baseExtraConfig = {};
250
+ const baseExtraConfig = {
251
+ _orderIdx: (cols)=>(0, _pgcore.index)('order_idx').on(cols._order),
252
+ _parentIDIdx: (cols)=>(0, _pgcore.index)('parent_id_idx').on(cols._parentID),
253
+ _pathIdx: (cols)=>(0, _pgcore.index)('path_idx').on(cols._path)
254
+ };
250
255
  if (field.localized && adapter.payload.config.localization) {
251
256
  baseColumns._locale = adapter.enums.enum__locales('_locale').notNull();
252
- baseExtraConfig._parentPathOrderLocale = (cols)=>(0, _pgcore.unique)(`${blockTableName}_unique`).on(cols._parentID, cols._path, cols._order, cols._locale);
253
- } else {
254
- baseExtraConfig._parentPathOrder = (cols)=>(0, _pgcore.unique)(`${blockTableName}_unique`).on(cols._parentID, cols._path, cols._order);
257
+ baseExtraConfig._localeIdx = (cols)=>(0, _pgcore.index)('locale_idx').on(cols._locale);
255
258
  }
256
259
  const { relationsToBuild: subRelationsToBuild } = (0, _build.buildTable)({
257
260
  adapter,
@@ -443,4 +446,4 @@ const traverseFields = ({ adapter, buildRelationships, collectionIndexes, column
443
446
  };
444
447
  };
445
448
 
446
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvdHJhdmVyc2VGaWVsZHMudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgUmVsYXRpb24gfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB0eXBlIHsgSW5kZXhCdWlsZGVyLCBQZ0NvbHVtbkJ1aWxkZXIsIFVuaXF1ZUNvbnN0cmFpbnRCdWlsZGVyIH0gZnJvbSAnZHJpenpsZS1vcm0vcGctY29yZSdcbmltcG9ydCB0eXBlIHsgRmllbGQsIFNhbml0aXplZENvbGxlY3Rpb25Db25maWcsIFRhYkFzRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyByZWxhdGlvbnMgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB7XG4gIFBnTnVtZXJpY0J1aWxkZXIsXG4gIFBnVmFyY2hhckJ1aWxkZXIsXG4gIGJvb2xlYW4sXG4gIGluZGV4LFxuICBpbnRlZ2VyLFxuICBqc29uYixcbiAgbnVtZXJpYyxcbiAgcGdFbnVtLFxuICB0ZXh0LFxuICB0aW1lc3RhbXAsXG4gIHVuaXF1ZSxcbiAgdmFyY2hhcixcbn0gZnJvbSAnZHJpenpsZS1vcm0vcGctY29yZSdcbmltcG9ydCB7IEludmFsaWRDb25maWd1cmF0aW9uIH0gZnJvbSAncGF5bG9hZC9lcnJvcnMnXG5pbXBvcnQgeyBmaWVsZEFmZmV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gICAgICBjYXNlICd0ZXh0YXJlYSc6IHtcbiAgICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXSA9IHZhcmNoYXIoY29sdW1uTmFtZSlcbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAnbnVtYmVyJzoge1xuICAgICAgICBpZiAoZmllbGQuaGFzTWFueSkge1xuICAgICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICAgIGhhc0xvY2FsaXplZE1hbnlOdW1iZXJGaWVsZCA9IHRydWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQuaW5kZXgpIHtcbiAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9ICdpbmRleCdcbiAgICAgICAgICB9IGVsc2UgaWYgKCFoYXNNYW55TnVtYmVyRmllbGQpIHtcbiAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9IHRydWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQudW5pcXVlKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZENvbmZpZ3VyYXRpb24oXG4gICAgICAgICAgICAgICdVbmlxdWUgaXMgbm90IHN1cHBvcnRlZCBpbiBQb3N0Z3JlcyBmb3IgaGFzTWFueSBudW1iZXIgZmllbGRzLicsXG4gICAgICAgICAgICApXG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRhcmdldFRhYmxlW2ZpZWxkTmFtZV0gPSBudW1lcmljKGNvbHVtbk5hbWUpXG4gICAgICAgIH1cbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAncmljaFRleHQnOlxuICAgICAgY2FzZSAnanNvbic6IHtcbiAgICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXSA9IGpzb25iKGNvbHVtbk5hbWUpXG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ2RhdGUnOiB7XG4gICAgICAgIHRhcmdldFRhYmxlW2ZpZWxkTmFtZV0gPSB0aW1lc3RhbXAoY29sdW1uTmFtZSwge1xuICAgICAgICAgIG1vZGU6ICdzdHJpbmcnLFxuICAgICAgICAgIHByZWNpc2lvbjogMyxcbiAgICAgICAgICB3aXRoVGltZXpvbmU6IHRydWUsXG4gICAgICAgIH0pXG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ3BvaW50Jzoge1xuICAgICAgICBicmVha1xuICAgICAgfVxuXG4gICAgICBjYXNlICdyYWRpbyc6XG4gICAgICBjYXNlICdzZWxlY3QnOiB7XG4gICAgICAgIGNvbnN0IGVudW1OYW1lID0gYGVudW1fJHtuZXdUYWJsZU5hbWV9XyR7Y29sdW1uUHJlZml4IHx8ICcnfSR7dG9TbmFrZUNhc2UoZmllbGQubmFtZSl9YFxuXG4gICAgICAgIGFkYXB0ZXIuZW51bXNbZW51bU5hbWVdID0gcGdFbnVtKFxuICAgICAgICAgIGVudW1OYW1lLFxuICAgICAgICAgIGZpZWxkLm9wdGlvbnMubWFwKChvcHRpb24pID0+IHtcbiAgICAgICAgICAgIGlmIChvcHRpb25Jc09iamVjdChvcHRpb24pKSB7XG4gICAgICAgICAgICAgIHJldHVybiBvcHRpb24udmFsdWVcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG9wdGlvblxuICAgICAgICAgIH0pIGFzIFtzdHJpbmcsIC4uLnN0cmluZ1tdXSxcbiAgICAgICAgKVxuXG4gICAgICAgIGlmIChmaWVsZC50eXBlID09PSAnc2VsZWN0JyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgY29uc3Qgc2VsZWN0VGFibGVOYW1lID0gYCR7bmV3VGFibGVOYW1lfV8ke3RvU25ha2VDYXNlKGZpZWxkTmFtZSl9YFxuICAgICAgICAgIGNvbnN0IGJhc2VDb2x1bW5zOiBSZWNvcmQ8c3RyaW5nLCBQZ0NvbHVtbkJ1aWxkZXI+ID0ge1xuICAgICAgICAgICAgb3JkZXI6IGludGVnZXIoJ29yZGVyJykubm90TnVsbCgpLFxuICAgICAgICAgICAgcGFyZW50OiBwYXJlbnRJRENvbHVtbk1hcFtwYXJlbnRJRENvbFR5cGVdKCdwYXJlbnRfaWQnKVxuICAgICAgICAgICAgICAucmVmZXJlbmNlcygoKSA9PiBhZGFwdGVyLnRhYmxlc1twYXJlbnRUYWJsZU5hbWVdLmlkLCB7IG9uRGVsZXRlOiAnY2FzY2FkZScgfSlcbiAgICAgICAgICAgICAgLm5vdE51bGwoKSxcbiAgICAgICAgICAgIHZhbHVlOiBhZGFwdGVyLmVudW1zW2VudW1OYW1lXSgndmFsdWUnKSxcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb25zdCBiYXNlRXh0cmFDb25maWc6IFJlY29yZDxcbiAgICAgICAgICAgIHN0cmluZyxcbiAgICAgICAgICAgIChjb2xzOiBHZW5lcmljQ29sdW1ucykgPT4gSW5kZXhCdWlsZGVyIHwgVW5pcXVlQ29uc3RyYWludEJ1aWxkZXJcbiAgICAgICAgICA+ID0ge31cblxuICAgICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICAgIGJhc2VDb2x1bW5zLmxvY2FsZSA9IGFkYXB0ZXIuZW51bXMuZW51bV9fbG9jYWxlcygnbG9jYWxlJykubm90TnVsbCgpXG4gICAgICAgICAgICBiYXNlRXh0cmFDb25maWcucGFyZW50T3JkZXJMb2NhbGUgPSAoY29scykgPT5cbiAgICAgICAgICAgICAgdW5pcXVlKGAke3NlbGVjdFRhYmxlTmFtZX1fdW5pcXVlYCkub24oY29scy5wYXJlbnQsIGNvbHMub3JkZXIsIGNvbHMubG9jYWxlKVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBiYXNlRXh0cmFDb25maWcucGFyZW50ID0gKGNvbHMpID0+IGluZGV4KCdwYXJlbnRfaWR4Jykub24oY29scy5wYXJlbnQpXG4gICAgICAgICAgICBiYXNlRXh0cmFDb25maWcub3JkZXIgPSAoY29scykgPT4gaW5kZXgoJ29yZGVyX2lkeCcpLm9uKGNvbHMub3JkZXIpXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGZpZWxkLmluZGV4KSB7XG4gICAgICAgICAgICBiYXNlRXh0cmFDb25maWcudmFsdWUgPSAoY29scykgPT4gaW5kZXgoJ3ZhbHVlX2lkeCcpLm9uKGNvbHMudmFsdWUpXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnVpbGRUYWJsZSh7XG4gICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgYmFzZUNvbHVtbnMsXG4gICAgICAgICAgICBiYXNlRXh0cmFDb25maWcsXG4gICAgICAgICAgICBkaXNhYmxlVW5pcXVlLFxuICAgICAgICAgICAgZmllbGRzOiBbXSxcbiAgICAgICAgICAgIHRhYmxlTmFtZTogc2VsZWN0VGFibGVOYW1lLFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICByZWxhdGlvbnNUb0J1aWxkLnNldChmaWVsZE5hbWUsIHNlbGVjdFRhYmxlTmFtZSlcblxuICAgICAgICAgIGNvbnN0IHNlbGVjdFRhYmxlUmVsYXRpb25zID0gcmVsYXRpb25zKGFkYXB0ZXIudGFibGVzW3NlbGVjdFRhYmxlTmFtZV0sICh7IG9uZSB9KSA9PiB7XG4gICAgICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIFJlbGF0aW9uPHN0cmluZz4+ID0ge1xuICAgICAgICAgICAgICBwYXJlbnQ6IG9uZShhZGFwdGVyLnRhYmxlc1twYXJlbnRUYWJsZU5hbWVdLCB7XG4gICAgICAgICAgICAgICAgZmllbGRzOiBbYWRhcHRlci50YWJsZXNbc2VsZWN0VGFibGVOYW1lXS5wYXJlbnRdLFxuICAgICAgICAgICAgICAgIHJlZmVyZW5jZXM6IFthZGFwdGVyLnRhYmxlc1twYXJlbnRUYWJsZU5hbWVdLmlkXSxcbiAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgYWRhcHRlci5yZWxhdGlvbnNbYHJlbGF0aW9uXyR7c2VsZWN0VGFibGVOYW1lfWBdID0gc2VsZWN0VGFibGVSZWxhdGlvbnNcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0YXJnZXRUYWJsZVtmaWVsZE5hbWVdID0gYWRhcHRlci5lbnVtc1tlbnVtTmFtZV0oZmllbGROYW1lKVxuICAgICAgICB9XG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ2NoZWNrYm94Jzoge1xuICAgICAgICB0YXJnZXRUYWJsZVtmaWVsZE5hbWVdID0gYm9vbGVhbihjb2x1bW5OYW1lKVxuICAgICAgICBicmVha1xuICAgICAgfVxuXG4gICAgICBjYXNlICdhcnJheSc6IHtcbiAgICAgICAgY29uc3QgYXJyYXlUYWJsZU5hbWUgPSBgJHtuZXdUYWJsZU5hbWV9XyR7dG9TbmFrZUNhc2UoZmllbGQubmFtZSl9YFxuICAgICAgICBjb25zdCBiYXNlQ29sdW1uczogUmVjb3JkPHN0cmluZywgUGdDb2x1bW5CdWlsZGVyPiA9IHtcbiAgICAgICAgICBfb3JkZXI6IGludGVnZXIoJ19vcmRlcicpLm5vdE51bGwoKSxcbiAgICAgICAgICBfcGFyZW50SUQ6IHBhcmVudElEQ29sdW1uTWFwW3BhcmVudElEQ29sVHlwZV0oJ19wYXJlbnRfaWQnKVxuICAgICAgICAgICAgLnJlZmVyZW5jZXMoKCkgPT4gYWRhcHRlci50YWJsZXNbcGFyZW50VGFibGVOYW1lXS5pZCwgeyBvbkRlbGV0ZTogJ2Nhc2NhZGUnIH0pXG4gICAgICAgICAgICAubm90TnVsbCgpLFxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgYmFzZUV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AgICAgICAgIHJvb3RUYWJsZUlEQ29sVHlwZSxcbiAgICAgICAgICByb290VGFibGVOYW1lLFxuICAgICAgICAgIHRhYmxlTmFtZTogYXJyYXlUYWJsZU5hbWUsXG4gICAgICAgIH0pXG5cbiAgICAgICAgcmVsYXRpb25zVG9CdWlsZC5zZXQoZmllbGROYW1lLCBhcnJheVRhYmxlTmFtZSlcblxuICAgICAgICBjb25zdCBhcnJheVRhYmxlUmVsYXRpb25zID0gcmVsYXRpb25zKGFkYXB0ZXIudGFibGVzW2FycmF5VGFibGVOYW1lXSwgKHsgbWFueSwgb25lIH0pID0+IHtcbiAgICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIFJlbGF0aW9uPHN0cmluZz4+ID0ge1xuICAgICAgICAgICAgX3BhcmVudElEOiBvbmUoYWRhcHRlci50YWJsZXNbcGFyZW50VGFibGVOYW1lXSwge1xuICAgICAgICAgICAgICBmaWVsZHM6IFthZGFwdGVyLnRhYmxlc1thcnJheVRhYmxlTmFtZV0uX3BhcmVudElEXSxcbiAgICAgICAgICAgICAgcmVmZXJlbmNlczogW2FkYXB0ZXIudGFibGVzW3BhcmVudFRhYmxlTmFtZV0uaWRdLFxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGhhc0xvY2FsZXNUYWJsZShmaWVsZC5maWVsZHMpKSB7XG4gICAgICAgICAgICByZXN1bHQuX2xvY2FsZXMgPSBtYW55KGFkYXB0ZXIudGFibGVzW2Ake2FycmF5VGFibGVOYW1lfV9sb2NhbGVzYF0pXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgc3ViUmVsYXRpb25zVG9CdWlsZC5mb3JFYWNoKCh2YWwsIGtleSkgPT4ge1xuICAgICAgICAgICAgcmVzdWx0W2tleV0gPSBtYW55KGFkYXB0ZXIudGFibGVzW3ZhbF0pXG4gICAgICAgICAgfSlcblxuICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgf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ludEJ1aWxkZXJcbiAgICAgICAgICAgID4gPSB7fVxuXG4gICAgICAgICAgICBpZiAoZmllbGQubG9jYWxpemVkICYmIGFkYXB0ZXIucGF5bG9hZC5jb25maWcubG9jYWxpemF0aW9uKSB7XG4gICAgICAgICAgICAgIGJhc2VDb2x1bW5zLl9sb2NhbGUgPSBhZGFwdGVyLmVudW1zLmVudW1fX2xvY2FsZXMoJ19sb2NhbGUnKS5ub3ROdWxsKClcbiAgICAgICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLl9wYXJlbnRQYXRoT3JkZXJMb2NhbGUgPSAoY29scykgPT5cbiAgICAgICAgICAgICAgICB1bmlxdWUoYCR7YmxvY2tUYWJsZU5hbWV9X3VuaXF1ZWApLm9uKFxuICAgICAgICAgICAgICAgICAgY29scy5fcGFyZW50SUQsXG4gICAgICAgICAgICAgICAgICBjb2xzLl9wYXRoLFxuICAgICAgICAgICAgICAgICAgY29scy5fb3JkZXIsXG4gICAgICAgICAgICAgICAgICBjb2xzLl9sb2NhbGUsXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgYmFzZUV4dHJhQ29uZmlnLl9wYXJlbnRQYXRoT3JkZXIgPSAoY29scykgPT5cbiAgICAgICAgICAgICAgICB1bmlxdWUoYCR7YmxvY2tUYWJsZU5hbWV9X3VuaXF1ZWApLm9uKGNvbHMuX3BhcmVudElELCBjb2xzLl9wYXRoLCBjb2xzLl9vcmRlcilcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgeyByZWxhdGlvbnNUb0J1aWxkOiBzdWJSZWxhdGlvbnNUb0J1aWxkIH0gPSBidWlsZFRhYmxlKHtcbiAgICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgICAgYmFzZUNvbHVtbnMsXG4gICAgICAgICAgICAgIGJhc2VFeHRyYUNvbmZpZyxcbiAgICAgICAgICAgICAgZGlzYWJsZVVuaXF1ZSxcbiAgICAgICAgICAgICAgZmllbGRzOiBibG9jay5maWVsZHMsXG4gICAgICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgICAgICByb290VGFibGVJRENvbFR5cGUsXG4gICAgICAgICAgICAgIHJvb3RUYWJsZU5hbWUsXG4gICAgICAgICAgICAgIHRhYmxlTmFtZTogYmxvY2tUYWJsZU5hbWUsXG4gICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICBjb25zdCBibG9ja1RhYmxlUmVsYXRpb25zID0gcmVsYXRpb25zKFxuICAgICAgICAgICAgICBhZGFwdGVyLnRhYmxlc1tibG9ja1RhYmxlTmFtZV0sXG4gICAgICAgICAgICAgICh7IG1hbnksIG9uZSB9KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0OiBSZWNvcmQ8c3RyaW5nLCBSZWxhdGlvbjxzdHJpbmc+PiA9IHtcbiAgICAgICAgICAgICAgICAgIF9wYXJlbnRJRDogb25lKGFkYXB0ZXIudGFibGVzW3Jvb3RUYWJsZU5hbWVdLCB7XG4gICAgICAgICAgICAgICAgICAgIGZpZWxkczogW2FkYXB0ZXIudGFibGVzW2Jsb2NrVGFibGVOYW1lXS5fcGFyZW50SURdLFxuICAgICAgICAgICAgICAgICAgICByZWZlcmVuY2VzOiBbYWRhcHRlci50YWJsZXNbcm9vdFRhYmxlTmFtZV0uaWRdLFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGhhc0xvY2FsZXNUYWJsZShibG9jay5maWVsZHMpKSB7XG4gICAgICAgICAgICAgICAgICByZXN1bHQuX2xvY2FsZXMgPSBtYW55KGFkYXB0ZXIudGFibGVzW2Ake2Jsb2NrVGFibGVOYW1lfV9sb2NhbGVzYF0pXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc3ViUmVsYXRpb25zVG9CdWlsZC5mb3JFYWNoKCh2YWwsIGtleSkgPT4ge1xuICAgICAgICAgICAgICAgICAgcmVzdWx0W2tleV0gPSBtYW55KGFkYXB0ZXIudGFibGVzW3ZhbF0pXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIClcblxuICAgICAgICAgICAgYWRhcHRlci5yZWxhdGlvbnNbYHJlbGF0aW9uc18ke2Jsb2NrVGFibGVOYW1lfWBdID0gYmxvY2tUYWJsZVJlbGF0aW9uc1xuICAgICAgICAgIH0gZWxzZSBpZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykge1xuICAgICAgICAgICAgdmFsaWRhdGVFeGlzdGluZ0Jsb2NrSXNJZGVudGljYWwoe1xuICAgICAgICAgICAgICBibG9jayxcbiAgICAgICAgICAgICAgbG9jYWxpemVkOiBmaWVsZC5sb2NhbGl6ZWQsXG4gICAgICAgICAgICAgIHJvb3RUYWJsZU5hbWUsXG4gICAgICAgICAgICAgIHRhYmxlOiBhZGFwdGVyLnRhYmxlc1tibG9ja1RhYmxlTmFtZV0sXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLnNldChgX2Jsb2Nrc18ke2Jsb2NrLnNsdWd9YCwgYmxvY2tUYWJsZU5hbWUpXG4gICAgICAgIH0pXG5cbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAndGFiJzpcbiAgICAgIGNhc2UgJ2dyb3VwJzoge1xuICAgICAgICBpZiAoISgnbmFtZScgaW4gZmllbGQpKSB7XG4gICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgaGFzTG9jYWxpemVkRmllbGQ6IGdyb3VwSGFzTG9jYWxpemVkRmllbGQsXG4gICAgICAgICAgICBoYXNMb2NhbGl6ZWRNYW55TnVtYmVyRmllbGQ6IGdyb3VwSGFzTG9jYWxpemVkTWFueU51bWJlckZpZWxkLFxuICAgICAgICAgICAgaGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQ6IGdyb3VwSGFzTG9jYWxpemVkUmVsYXRpb25zaGlwRmllbGQsXG4gICAgICAgICAgICBoYXNNYW55TnVtYmVyRmllbGQ6IGdyb3VwSGFzTWFueU51bWJlckZpZWxkLFxuICAgICAgICAgIH0gPSB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgYnVpbGRSZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgY29sbGVjdGlvbkluZGV4ZXMsXG4gICAgICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgICAgICBjb2x1bW5zLFxuICAgICAgICAgICAgZGlzYWJsZVVuaXF1ZSxcbiAgICAgICAgICAgIGZpZWxkUHJlZml4LFxuICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICBmb3JjZUxvY2FsaXplZCxcbiAgICAgICAgICAgIGluZGV4ZXMsXG4gICAgICAgICAgICBsb2NhbGVzQ29sdW1ucyxcbiAgICAgICAgICAgIGxvY2FsZXNJbmRleGVzLFxuICAgICAgICAgICAgbmV3VGFibGVOYW1lOiBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICByZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgICAgcm9vdFRhYmxlSURDb2xUeXBlLFxuICAgICAgICAgICAgcm9vdFRhYmxlTmFtZSxcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgaWYgKGdyb3VwSGFzTG9jYWxpemVkRmllbGQpIGhhc0xvY2FsaXplZEZpZWxkID0gdHJ1ZVxuICAgICAgICAgIGlmIChncm91cEh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ICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKGZpZWxkLnR5cGUpIHtcbiAgICAgIGNhc2UgJ3RleHQnOlxuICAgICAgY2FzZSAnZW1haWwnOlxuICAgICAgY2FzZSAnY29kZSc6XG4gICAgICBjYXNlICd0ZXh0YXJlYSc6IHtcbiAgICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXSA9IHZhcmNoYXIoY29sdW1uTmFtZSlcbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAnbnVtYmVyJzoge1xuICAgICAgICBpZiAoZmllbGQuaGFzTWFueSkge1xuICAgICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQpIHtcbiAgICAgICAgICAgIGhhc0xvY2FsaXplZE1hbnlOdW1iZXJGaWVsZCA9IHRydWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQuaW5kZXgpIHtcbiAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9ICdpbmRleCdcbiAgICAgICAgICB9IGVsc2UgaWYgKCFoYXNNYW55TnVtYmVyRmllbGQpIHtcbiAgICAgICAgICAgIGhhc01hbnlOdW1iZXJGaWVsZCA9IHRydWVcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmllbGQudW5pcXVlKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZENvbmZpZ3VyYXRpb24oXG4gICAgICAgICAgICAgICdVbmlxdWUgaXMgbm90IHN1cHBvcnRlZCBpbiBQb3N0Z3JlcyBmb3IgaGFzTWFueSBudW1iZXIgZmllbGRzLicsXG4gICAgICAgICAgICApXG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRhcmdldFRhYmxlW2ZpZWxkTmFtZV0gPSBudW1lcmljKGNvbHVtbk5hbWUpXG4gICAgICAgIH1cbiAgICAgICAgYnJlYWtcbiAgICAgIH1cblxuICAgICAgY2FzZSAncmljaFRleHQnOlxuICAgICAgY2FzZSAnanNvbic6IHtcbiAgICAgICAgdGFyZ2V0VGFibGVbZmllbGROYW1lXSA9IGpzb25iKGNvbHVtbk5hbWUpXG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ2RhdGUnOiB7XG4gICAgICAgIHRhcmdldFRhYmxlW2ZpZWxkTmFtZV0gPSB0aW1lc3RhbXAoY29sdW1uTmFtZSwge1xuICAgICAgICAgIG1vZGU6ICdzdHJpbmcnLFxuICAgICAgICAgIHByZWNpc2lvbjogMyxcbiAgICAgICAgICB3aXRoVGltZXpvbmU6IHRydWUsXG4gICAgICAgIH0pXG4gICAgICAgIGJyZWFrXG4gICAgICB9XG5cbiAgICAgIGNhc2UgJ3BvaW50Jzoge1xuICAgICAgICBicmVha1xuICAgICAgfVxuXG4gICAgICBjYXNlICdyYWRpbyc6XG4gICAgICBjYXNlICdzZWxlY3QnOiB7XG4gICAgICAgIGNvbnN0IGVudW1OYW1lID0gYGVudW1fJHtuZXdUYWJsZU5hbWV9XyR7Y29sdW1uUHJlZml4IHx8ICcnfSR7dG9TbmFrZUNhc2UoZmllbGQubmFtZSl9YFxuXG4gICAgICAgIGFkYXB0ZXIuZW51bXNbZW51bU5hbWVdID0gcGdFbnVtKFxuICAgICAgICAgIGVudW1OYW1lLFxuICAgICAgICAgIGZpZWxkLm9wdGlvbnMubWFwKChvcHRpb24pID0+IHtcbiAgICAgICAgICAgIGlmIChvcHRpb25Jc09iamVjdChvcHRpb24pKSB7XG4gICAgICAgICAgICAgIHJldHVybiBvcHRpb24udmFsdWVcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG9wdGlvblxuICAgICAgICAgIH0pIGFzIFtzdHJpbmcsIC4uLnN0cmluZ1tdXSxcbiAgICAgICAgKVxuXG4gICAgICAgIGlmIChmaWVsZC50eXBlID09PSAnc2VsZWN0JyAmJiBmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgY29uc3Qgc2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vb3RUYWJsZU5hbWUsXG4gICAgICAgICAgdGFibGVOYW1lOiBhcnJheVRhYmxlTmFtZSxcbiAgICAgICAgfSlcblxuICAgICAgICByZWxhdGlvbnNUb0J1aWxkLnNldChmaWVsZE5hbWUsIGFycmF5VGFibGVOYW1lKVxuXG4gICAgICAgIGNvbnN0IGFycmF5VGFibGVSZWxhdGlvbnMgPSByZWxhdGlvbnMoYWRhcHRlci50YWJsZXNbYXJyYXlUYWJsZU5hbWVdLCAoeyBtYW55LCBvbmUgfSkgPT4ge1xuICAgICAgICAgIGNvbnN0IHJlc3VsdDogUmVjb3JkPHN0cmluZywgUmVsYXRpb248c3RyaW5nPj4gPSB7XG4gICAgICAgICAgICBfcGFyZW50SUQ6IG9uZShhZGFwdGVyLnRhYmxlc1twYXJlbnRUYWJsZU5hbWVdLCB7XG4gICAgICAgICAgICAgIGZpZWxkczogW2FkYXB0ZXIudGFibGVzW2FycmF5VGFibGVOYW1lXS5fcGFyZW50SURdLFxuICAgICAgICAgICAgICByZWZlcmVuY2VzOiBbYWRhcHRlci50YWJsZXNbcGFyZW50VGFibGVOYW1lXS5pZF0sXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoaGFzTG9jYWxlc1RhYmxlKGZpZWxkLmZpZWxkcykpIHtcbiAgICAgICAgICAgIHJlc3VsdC5fbG9jYWxlcyA9IG1hbnkoYWRhcHRlci50YWJsZXNbYCR7YXJyYXlUYWJsZU5hbWV9X2xvY2FsZXNgXSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBzdWJSZWxhdGlvbnNUb0J1aWxkLmZvckVhY2goKHZhbCwga2V5KSA9PiB7XG4gICAgICAgICAgICByZXN1bHRba2V5XSA9IG1hbnkoYWRhcHRlci50YWJsZXNbdmFsXSlcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgcmV0dXJuIHJlc3VsdFxuICAgICAgICB9KVxuXG4gICAgICAgIGFkYXB0ZXIucmVsYXRpb25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gICAgICAgICAgX29yZGVySWR4OiAoY29scykgPT4gaW5kZXgoJ29yZGVyX2lkeCcpLm9uKGNvbHMuX29yZGVyKSxcbiAgICAgICAgICAgICAgX3BhcmVudElESWR4OiAoY29scykgPT4gaW5kZXgoJ3BhcmVudF9pZF9pZHgnKS5vbihjb2xzLl9wYXJlbnRJRCksXG4gICAgICAgICAgICAgIF9wYXRoSWR4OiAoY29scykgPT4gaW5kZXgoJ3BhdGhfaWR4Jykub24oY29scy5fcGF0aCksXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChmaWVsZC5sb2NhbGl6ZWQgJiYgYWRhcHRlci5wYXlsb2FkLmNvbmZpZy5sb2NhbGl6YXRpb24pIHtcbiAgICAgICAgICAgICAgYmFzZUNvbHVtbnMuX2xvY2FsZSA9IGFkYXB0ZXIuZW51bXMuZW51bV9fbG9jYWxlcygnX2xvY2FsZScpLm5vdE51bGwoKVxuICAgICAgICAgICAgICBiYXNlRXh0cmFDb25maWcuX2xvY2FsZUlkeCA9IChjb2xzKSA9PiBpbmRleCgnbG9jYWxlX2lkeCcpLm9uKGNvbHMuX2xvY2FsZSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgeyByZWxhdGlvbnNUb0J1aWxkOiBzdWJSZWxhdGlvbnNUb0J1aWxkIH0gPSBidWlsZFRhYmxlKHtcbiAgICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgICAgYmFzZUNvbHVtbnMsXG4gICAgICAgICAgICAgIGJhc2VFeHRyYUNvbmZpZyxcbiAgICAgICAgICAgICAgZGlzYWJsZVVuaXF1ZSxcbiAgICAgICAgICAgICAgZmllbGRzOiBibG9jay5maWVsZHMsXG4gICAgICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgICAgICByb290VGFibGVJRENvbFR5cGUsXG4gICAgICAgICAgICAgIHJvb3RUYWJsZU5hbWUsXG4gICAgICAgICAgICAgIHRhYmxlTmFtZTogYmxvY2tUYWJsZU5hbWUsXG4gICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICBjb25zdCBibG9ja1RhYmxlUmVsYXRpb25zID0gcmVsYXRpb25zKFxuICAgICAgICAgICAgICBhZGFwdGVyLnRhYmxlc1tibG9ja1RhYmxlTmFtZV0sXG4gICAgICAgICAgICAgICh7IG1hbnksIG9uZSB9KSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0OiBSZWNvcmQ8c3RyaW5nLCBSZWxhdGlvbjxzdHJpbmc+PiA9IHtcbiAgICAgICAgICAgICAgICAgIF9wYXJlbnRJRDogb25lKGFkYXB0ZXIudGFibGVzW3Jvb3RUYWJsZU5hbWVdLCB7XG4gICAgICAgICAgICAgICAgICAgIGZpZWxkczogW2FkYXB0ZXIudGFibGVzW2Jsb2NrVGFibGVOYW1lXS5fcGFyZW50SURdLFxuICAgICAgICAgICAgICAgICAgICByZWZlcmVuY2VzOiBbYWRhcHRlci50YWJsZXNbcm9vdFRhYmxlTmFtZV0uaWRdLFxuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGhhc0xvY2FsZXNUYWJsZShibG9jay5maWVsZHMpKSB7XG4gICAgICAgICAgICAgICAgICByZXN1bHQuX2xvY2FsZXMgPSBtYW55KGFkYXB0ZXIudGFibGVzW2Ake2Jsb2NrVGFibGVOYW1lfV9sb2NhbGVzYF0pXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc3ViUmVsYXRpb25zVG9CdWlsZC5mb3JFYWNoKCh2YWwsIGtleSkgPT4ge1xuICAgICAgICAgICAgICAgICAgcmVzdWx0W2tleV0gPSBtYW55KGFkYXB0ZXIudGFibGVzW3ZhbF0pXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIClcblxuICA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U51bWJlckZpZWxkLFxuICAgICAgICAgIH0gPSB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgYnVpbGRSZWxhdGlvbnNoaXBzLFxuICAgICAgICAgICAgY29sbGVjdGlvbkluZGV4ZXMsXG4gICAgICAgICAgICBjb2x1bW5QcmVmaXgsXG4gICAgICAgICAgICBjb2x1bW5zLFxuICAgICAgICAgICAgZGlzYWJsZVVuaXF1ZSxcbiAgICAgICAgICAgIGZpZWxkUHJlZml4LFxuICAgICAgICAgICAgZmllbGRzOiBmaWVsZC5maWVsZHMsXG4gICAgICAgICAgICBmb3JjZUxvY2FsaXplZCxcbiAgICAgICAgICAgIGluZGV4ZXMsXG4gICAgICAgICAgICBsb2NhbGVzQ29sdW1ucyxcbiAgICAgICAgICAgIGxvY2FsZXNJbmRleGVzLFxuICAgICAgICAgICAgbmV3VGFibGVOYW1lOiBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICBwYXJlbnRUYWJsZU5hbWUsXG4gICAgICAgICAgICByZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgICAgcmVsYXRpb25zaGlwcyxcbiAgICAgICAgICAgIHJvb3RSZWxhdGlvbnNUb0J1aWxkLFxuICAgICAgICAgICAgcm9vdFRhYmxlSURDb2xUeXBlLFxuICAgICAgICAgICAgcm9vdFRhYmxlTmFtZSxcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgaWYgKGdyb3VwSGFzTG9jYWxpemVkRmllbGQpIGhhc0xvY2FsaXplZEZpZWxkID0gdHJ1ZVxuICAgICAgICAgIGlmIChncm91cEhhc0xvY2FsaXplZFJlbGF0aW9uc2hpcEZpZWxkKSBoYXNMb2NhbGl6ZWRSZWxhdGlvbnNoaXBGaWVsZCA9IHRydWVcbiAgICAgICAgICBpZiAoZ3JvdXBIYXNNYW55TnVtYmVyRmllbGQpIGhhc01hbnlOdW1iZXJGaWVsZCA9IHRydWVcbiAgICAg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Bb0I7b0JBQzlDLElBQUlvSCxrQ0FBa0NuSCxnQ0FBZ0M7b0JBQ3RFLElBQUlvSCx1QkFBdUJuSCxxQkFBcUI7b0JBQ2hELElBQUlpSCxnQ0FBZ0NoSCw4QkFBOEI7b0JBQ2xFO2dCQUNGO1lBRUEsS0FBSztZQUNMLEtBQUs7Z0JBQ0gsSUFBSW1ILE1BQU1DLE9BQU8sQ0FBQzlHLE1BQU0rRyxVQUFVLEdBQUc7b0JBQ25DL0csTUFBTStHLFVBQVUsQ0FBQ2hILE9BQU8sQ0FBQyxDQUFDaUgsV0FBYTdILGNBQWM4SCxHQUFHLENBQUNEO2dCQUMzRCxPQUFPO29CQUNMN0gsY0FBYzhILEdBQUcsQ0FBQ2pILE1BQU0rRyxVQUFVO2dCQUNwQztnQkFFQSxJQUFJL0csTUFBTVcsU0FBUyxJQUFJdkMsUUFBUW9DLE9BQU8sQ0FBQ0MsTUFBTSxDQUFDQyxZQUFZLEVBQUU7b0JBQzFEbEIsZ0NBQWdDO2dCQUNsQztnQkFDQTtZQUVGO2dCQUNFO1FBQ0o7UUFFQSxNQUFNMEgsWUFBWWxILE1BQU1tSCxLQUFLLElBQUluSCxNQUFNbUgsS0FBSyxDQUFDRCxTQUFTO1FBRXRELElBQUk5RyxXQUFXLENBQUNELFVBQVUsSUFBSSxjQUFjSCxTQUFTQSxNQUFNb0gsUUFBUSxJQUFJLENBQUNGLFdBQVc7WUFDakY5RyxXQUFXLENBQUNELFVBQVUsQ0FBQzJDLE9BQU87UUFDaEM7SUFDRjtJQUVBLE9BQU87UUFDTHZEO1FBQ0FHO1FBQ0FGO1FBQ0FDO0lBQ0Y7QUFDRiJ9
package/dist/types.d.ts CHANGED
@@ -8,6 +8,7 @@ export type DrizzleDB = NodePgDatabase<Record<string, unknown>>;
8
8
  export type Args = {
9
9
  migrationDir?: string;
10
10
  pool: PoolConfig;
11
+ push?: boolean;
11
12
  };
12
13
  export type GenericColumn = PgColumn<ColumnBaseConfig<ColumnDataType, string>, Record<string, unknown>>;
13
14
  export type GenericColumns = {
@@ -27,6 +28,7 @@ export type PostgresAdapter = BaseDatabaseAdapter & {
27
28
  enums: Record<string, GenericEnum>;
28
29
  pool: Pool;
29
30
  poolOptions: Args['pool'];
31
+ push: boolean;
30
32
  relations: Record<string, GenericRelation>;
31
33
  schema: Record<string, GenericEnum | GenericRelation | GenericTable>;
32
34
  sessions: {
@@ -52,6 +54,7 @@ declare module 'payload' {
52
54
  drizzle: DrizzleDB;
53
55
  enums: Record<string, GenericEnum>;
54
56
  pool: Pool;
57
+ push: boolean;
55
58
  relations: Record<string, GenericRelation>;
56
59
  schema: Record<string, GenericEnum | GenericRelation | GenericTable>;
57
60
  sessions: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,QAAQ,EACR,SAAS,EACV,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAE1C,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAE/D,MAAM,MAAM,IAAI,GAAG;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,UAAU,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,CAClC,gBAAgB,CAAC,cA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MAAM,EAAE,eAAe,CAAC,CAAA;QAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,eAAe,GAAG,YAAY,CAAC,CAAA;QACpE,QAAQ,EAAE;YACR,CAAC,EAAE,EAAE,MAAM,GAAG;gBACZ,EAAE,EAAE,kBAAkB,CAAA;gBACtB,MAAM,EAAE,MAAM,IAAI,CAAA;gBAClB,OAAO,EAAE,MAAM,IAAI,CAAA;aACpB,CAAA;SACF,CAAA;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;KACrC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AASjD,eAAO,MAAM,SAAS,EAAE,SA6BvB,CAAA"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAWjD,eAAO,MAAM,SAAS,EAAE,SAkEvB,CAAA"}
package/dist/update.js CHANGED
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "updateOne", {
9
9
  }
10
10
  });
11
11
  const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
12
+ const _chainMethods = require("./find/chainMethods");
12
13
  const _buildQuery = /*#__PURE__*/ _interop_require_default(require("./queries/buildQuery"));
13
14
  const _upsertRow = require("./upsertRow");
14
15
  function _interop_require_default(obj) {
@@ -25,24 +26,69 @@ const updateOne = async function updateOne({ id, collection: collectionSlug, dat
25
26
  equals: id
26
27
  }
27
28
  };
28
- const { where } = await (0, _buildQuery.default)({
29
+ const { joinAliases, joins, selectFields, where } = await (0, _buildQuery.default)({
29
30
  adapter: this,
30
31
  fields: collection.fields,
31
32
  locale,
32
33
  tableName,
33
34
  where: whereToUse
34
35
  });
36
+ let idToUpdate = id;
37
+ // only fetch IDs when a sort or where query is used that needs to be done on join tables, otherwise these can be done directly on the table in findMany
38
+ if (Object.keys(joins).length > 0 || joinAliases.length > 0) {
39
+ const selectDistinctMethods = [];
40
+ if (where) {
41
+ selectDistinctMethods.push({
42
+ args: [
43
+ where
44
+ ],
45
+ method: 'where'
46
+ });
47
+ }
48
+ joinAliases.forEach(({ condition, table })=>{
49
+ selectDistinctMethods.push({
50
+ args: [
51
+ table,
52
+ condition
53
+ ],
54
+ method: 'leftJoin'
55
+ });
56
+ });
57
+ Object.entries(joins).forEach(([joinTable, condition])=>{
58
+ if (joinTable) {
59
+ selectDistinctMethods.push({
60
+ args: [
61
+ this.tables[joinTable],
62
+ condition
63
+ ],
64
+ method: 'leftJoin'
65
+ });
66
+ }
67
+ });
68
+ selectDistinctMethods.push({
69
+ args: [
70
+ 1
71
+ ],
72
+ method: 'limit'
73
+ });
74
+ const selectDistinctResult = await (0, _chainMethods.chainMethods)({
75
+ methods: selectDistinctMethods,
76
+ query: db.selectDistinct(selectFields).from(this.tables[tableName])
77
+ });
78
+ if (selectDistinctResult?.[0]?.id) {
79
+ idToUpdate = selectDistinctResult?.[0]?.id;
80
+ }
81
+ }
35
82
  const result = await (0, _upsertRow.upsertRow)({
36
- id,
83
+ id: idToUpdate,
37
84
  adapter: this,
38
85
  data,
39
86
  db,
40
87
  fields: collection.fields,
41
88
  operation: 'update',
42
- tableName: (0, _tosnakecase.default)(collectionSlug),
43
- where
89
+ tableName: (0, _tosnakecase.default)(collectionSlug)
44
90
  });
45
91
  return result;
46
92
  };
47
93
 
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBVcGRhdGVPbmUgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSA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FzQixDQUFDLEVBQUUsRUFBRXhDO1FBQzFDO0lBQ0Y7SUFFQSxNQUFNOEMsU0FBUyxNQUFNQyxJQUFBQSxvQkFBUyxFQUFDO1FBQzdCL0MsSUFBSTBCO1FBQ0pGLFNBQVMsSUFBSTtRQUNickI7UUFDQU07UUFDQWdCLFFBQVF4QixXQUFXd0IsTUFBTTtRQUN6QnVCLFdBQVc7UUFDWGhDLFdBQVdDLElBQUFBLG9CQUFXLEVBQUNmO0lBQ3pCO0lBRUEsT0FBTzRDO0FBQ1QifQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Format error message with hint if available
3
+ */
4
+ export declare const parseError: (err: unknown, msg: string) => string;
5
+ //# sourceMappingURL=parseError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseError.d.ts","sourceRoot":"","sources":["../../src/utilities/parseError.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,UAAU,QAAS,OAAO,OAAO,MAAM,KAAG,MAUtD,CAAA"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "parseError", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return parseError;
9
+ }
10
+ });
11
+ const _pg = require("pg");
12
+ const parseError = (err, msg)=>{
13
+ let formattedMsg = `${msg}`;
14
+ if (err instanceof Error) {
15
+ formattedMsg += ` ${err.message}.`;
16
+ if (err instanceof _pg.DatabaseError) {
17
+ msg += `: ${err.message}`;
18
+ if (err.hint) msg += ` ${err.hint}.`;
19
+ }
20
+ }
21
+ return formattedMsg;
22
+ };
23
+
24
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcGFyc2VFcnJvci50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEYXRhYmFzZUVycm9yIH0gZnJvbSAncGcnXG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yxDQUFDLENBQUM7UUFDdEM7SUFDRjtJQUNBLE9BQU9KO0FBQ1QifQ==
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/db-postgres",
3
- "version": "0.1.0-beta.17",
3
+ "version": "0.1.0-beta.19",
4
4
  "description": "The officially supported Postgres database adapter for Payload",
5
5
  "repository": "https://github.com/payloadcms/payload",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -55,6 +55,7 @@ export function postgresAdapter(args: Args): PostgresAdapterResult {
55
55
  enums: {},
56
56
  pool: undefined,
57
57
  poolOptions: args.pool,
58
+ push: args.push,
58
59
  relations: {},
59
60
  schema: {},
60
61
  sessions: {},