@pgpmjs/core 6.6.4 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,7 +26,6 @@ const DB_REQUIRED_EXTENSIONS = [
|
|
|
26
26
|
'vector',
|
|
27
27
|
'metaschema-schema',
|
|
28
28
|
'pgpm-inflection',
|
|
29
|
-
'pgpm-uuid',
|
|
30
29
|
'pgpm-utils',
|
|
31
30
|
'pgpm-database-jobs',
|
|
32
31
|
'pgpm-jwt-claims',
|
|
@@ -190,7 +189,11 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
|
|
|
190
189
|
: schemas.rows.filter((schema) => schema_names.includes(schema.schema_name));
|
|
191
190
|
const metaReplacer = makeReplacer({
|
|
192
191
|
schemas: metaSchemasForReplacement,
|
|
193
|
-
name: metaExtensionName
|
|
192
|
+
name: metaExtensionName,
|
|
193
|
+
// Use extensionName for schema prefix — the services metadata references
|
|
194
|
+
// schemas owned by the application package (e.g. agent_db_auth_public),
|
|
195
|
+
// not the services package (agent_db_services_auth_public)
|
|
196
|
+
schemaPrefix: name
|
|
194
197
|
});
|
|
195
198
|
// Create separate files for each table type
|
|
196
199
|
const metaPackage = [];
|
|
@@ -388,11 +391,12 @@ const preparePackage = async ({ project, author, outdir, name, description, exte
|
|
|
388
391
|
/**
|
|
389
392
|
* Generates a function for replacing schema names and extension names in strings.
|
|
390
393
|
*/
|
|
391
|
-
const makeReplacer = ({ schemas, name }) => {
|
|
394
|
+
const makeReplacer = ({ schemas, name, schemaPrefix }) => {
|
|
392
395
|
const replacements = ['constructive-extension-name', name];
|
|
396
|
+
const prefix = schemaPrefix || name;
|
|
393
397
|
const schemaReplacers = schemas.map((schema) => [
|
|
394
398
|
schema.schema_name,
|
|
395
|
-
toSnakeCase(`${
|
|
399
|
+
toSnakeCase(`${prefix}_${schema.name}`)
|
|
396
400
|
]);
|
|
397
401
|
const replace = [...schemaReplacers, replacements].map(([from, to]) => [new RegExp(from, 'g'), to]);
|
|
398
402
|
const replacer = (str, n = 0) => {
|
package/esm/modules/modules.js
CHANGED
|
@@ -16,8 +16,7 @@ export const PGPM_MODULE_MAP = {
|
|
|
16
16
|
'pgpm-stamps': '@pgpm/stamps',
|
|
17
17
|
'pgpm-totp': '@pgpm/totp',
|
|
18
18
|
'pgpm-types': '@pgpm/types',
|
|
19
|
-
'pgpm-utils': '@pgpm/utils'
|
|
20
|
-
'pgpm-uuid': '@pgpm/uuid'
|
|
19
|
+
'pgpm-utils': '@pgpm/utils'
|
|
21
20
|
};
|
|
22
21
|
/**
|
|
23
22
|
* Determines which pgpm modules from an extensions list are missing from the installed modules.
|
|
@@ -32,7 +32,6 @@ const DB_REQUIRED_EXTENSIONS = [
|
|
|
32
32
|
'vector',
|
|
33
33
|
'metaschema-schema',
|
|
34
34
|
'pgpm-inflection',
|
|
35
|
-
'pgpm-uuid',
|
|
36
35
|
'pgpm-utils',
|
|
37
36
|
'pgpm-database-jobs',
|
|
38
37
|
'pgpm-jwt-claims',
|
|
@@ -196,7 +195,11 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
|
|
|
196
195
|
: schemas.rows.filter((schema) => schema_names.includes(schema.schema_name));
|
|
197
196
|
const metaReplacer = makeReplacer({
|
|
198
197
|
schemas: metaSchemasForReplacement,
|
|
199
|
-
name: metaExtensionName
|
|
198
|
+
name: metaExtensionName,
|
|
199
|
+
// Use extensionName for schema prefix — the services metadata references
|
|
200
|
+
// schemas owned by the application package (e.g. agent_db_auth_public),
|
|
201
|
+
// not the services package (agent_db_services_auth_public)
|
|
202
|
+
schemaPrefix: name
|
|
200
203
|
});
|
|
201
204
|
// Create separate files for each table type
|
|
202
205
|
const metaPackage = [];
|
|
@@ -395,11 +398,12 @@ const preparePackage = async ({ project, author, outdir, name, description, exte
|
|
|
395
398
|
/**
|
|
396
399
|
* Generates a function for replacing schema names and extension names in strings.
|
|
397
400
|
*/
|
|
398
|
-
const makeReplacer = ({ schemas, name }) => {
|
|
401
|
+
const makeReplacer = ({ schemas, name, schemaPrefix }) => {
|
|
399
402
|
const replacements = ['constructive-extension-name', name];
|
|
403
|
+
const prefix = schemaPrefix || name;
|
|
400
404
|
const schemaReplacers = schemas.map((schema) => [
|
|
401
405
|
schema.schema_name,
|
|
402
|
-
(0, komoji_1.toSnakeCase)(`${
|
|
406
|
+
(0, komoji_1.toSnakeCase)(`${prefix}_${schema.name}`)
|
|
403
407
|
]);
|
|
404
408
|
const replace = [...schemaReplacers, replacements].map(([from, to]) => [new RegExp(from, 'g'), to]);
|
|
405
409
|
const replacer = (str, n = 0) => {
|
package/modules/modules.js
CHANGED
|
@@ -19,8 +19,7 @@ exports.PGPM_MODULE_MAP = {
|
|
|
19
19
|
'pgpm-stamps': '@pgpm/stamps',
|
|
20
20
|
'pgpm-totp': '@pgpm/totp',
|
|
21
21
|
'pgpm-types': '@pgpm/types',
|
|
22
|
-
'pgpm-utils': '@pgpm/utils'
|
|
23
|
-
'pgpm-uuid': '@pgpm/uuid'
|
|
22
|
+
'pgpm-utils': '@pgpm/utils'
|
|
24
23
|
};
|
|
25
24
|
/**
|
|
26
25
|
* Determines which pgpm modules from an extensions list are missing from the installed modules.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PGPM Package and Migration Tools",
|
|
6
6
|
"main": "index.js",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@pgpmjs/env": "^2.15.3",
|
|
52
52
|
"@pgpmjs/logger": "^2.4.3",
|
|
53
|
+
"@pgpmjs/migrate-client": "^0.1.0",
|
|
53
54
|
"@pgpmjs/server-utils": "^3.4.4",
|
|
54
55
|
"@pgpmjs/types": "^2.19.3",
|
|
55
56
|
"csv-to-pg": "^3.10.4",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"pgsql-parser": "^17.9.13",
|
|
66
67
|
"yanse": "^0.2.1"
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "9f3837555601b15e693ae0b750124fb0a8df3176"
|
|
69
70
|
}
|