@pgpmjs/core 6.6.4 → 6.6.5

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.
@@ -190,7 +190,11 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
190
190
  : schemas.rows.filter((schema) => schema_names.includes(schema.schema_name));
191
191
  const metaReplacer = makeReplacer({
192
192
  schemas: metaSchemasForReplacement,
193
- name: metaExtensionName
193
+ name: metaExtensionName,
194
+ // Use extensionName for schema prefix — the services metadata references
195
+ // schemas owned by the application package (e.g. agent_db_auth_public),
196
+ // not the services package (agent_db_services_auth_public)
197
+ schemaPrefix: name
194
198
  });
195
199
  // Create separate files for each table type
196
200
  const metaPackage = [];
@@ -388,11 +392,12 @@ const preparePackage = async ({ project, author, outdir, name, description, exte
388
392
  /**
389
393
  * Generates a function for replacing schema names and extension names in strings.
390
394
  */
391
- const makeReplacer = ({ schemas, name }) => {
395
+ const makeReplacer = ({ schemas, name, schemaPrefix }) => {
392
396
  const replacements = ['constructive-extension-name', name];
397
+ const prefix = schemaPrefix || name;
393
398
  const schemaReplacers = schemas.map((schema) => [
394
399
  schema.schema_name,
395
- toSnakeCase(`${name}_${schema.name}`)
400
+ toSnakeCase(`${prefix}_${schema.name}`)
396
401
  ]);
397
402
  const replace = [...schemaReplacers, replacements].map(([from, to]) => [new RegExp(from, 'g'), to]);
398
403
  const replacer = (str, n = 0) => {
@@ -196,7 +196,11 @@ const exportMigrationsToDisk = async ({ project, options, database, databaseId,
196
196
  : schemas.rows.filter((schema) => schema_names.includes(schema.schema_name));
197
197
  const metaReplacer = makeReplacer({
198
198
  schemas: metaSchemasForReplacement,
199
- name: metaExtensionName
199
+ name: metaExtensionName,
200
+ // Use extensionName for schema prefix — the services metadata references
201
+ // schemas owned by the application package (e.g. agent_db_auth_public),
202
+ // not the services package (agent_db_services_auth_public)
203
+ schemaPrefix: name
200
204
  });
201
205
  // Create separate files for each table type
202
206
  const metaPackage = [];
@@ -395,11 +399,12 @@ const preparePackage = async ({ project, author, outdir, name, description, exte
395
399
  /**
396
400
  * Generates a function for replacing schema names and extension names in strings.
397
401
  */
398
- const makeReplacer = ({ schemas, name }) => {
402
+ const makeReplacer = ({ schemas, name, schemaPrefix }) => {
399
403
  const replacements = ['constructive-extension-name', name];
404
+ const prefix = schemaPrefix || name;
400
405
  const schemaReplacers = schemas.map((schema) => [
401
406
  schema.schema_name,
402
- (0, komoji_1.toSnakeCase)(`${name}_${schema.name}`)
407
+ (0, komoji_1.toSnakeCase)(`${prefix}_${schema.name}`)
403
408
  ]);
404
409
  const replace = [...schemaReplacers, replacements].map(([from, to]) => [new RegExp(from, 'g'), to]);
405
410
  const replacer = (str, n = 0) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/core",
3
- "version": "6.6.4",
3
+ "version": "6.6.5",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM Package and Migration Tools",
6
6
  "main": "index.js",
@@ -65,5 +65,5 @@
65
65
  "pgsql-parser": "^17.9.13",
66
66
  "yanse": "^0.2.1"
67
67
  },
68
- "gitHead": "8afe6b19da82facbe5f3365762ba52888af5b3c9"
68
+ "gitHead": "9c322f47ca08b5b853fcb395fe2bfc224f8c4c27"
69
69
  }