masterrecord 0.2.13 → 0.2.16

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.
package/Migrations/cli.js CHANGED
@@ -569,23 +569,21 @@ program.option('-V', 'output the version');
569
569
  var executedLocation = process.cwd();
570
570
  try{
571
571
  // Find all context snapshots and run update per snapshot (avoids unrelated framework contexts)
572
- var snapshotFiles = globSearch.sync(`**/*_contextSnapShot.json`, { cwd: executedLocation, dot: true, windowsPathsNoEscape: true });
572
+ var snapshotFiles = globSearch.sync(path.join(executedLocation, '**', '*_contextSnapShot.json'), executedLocation);
573
573
  if(!(snapshotFiles && snapshotFiles.length)){
574
574
  console.log('No context snapshots found. Run enable-migrations for each context first.');
575
575
  return;
576
576
  }
577
577
  // Group snapshots by context name (case-insensitive) and pick best per group
578
578
  var groups = {};
579
- for(const snapRel of snapshotFiles){
580
- const snapFile = path.resolve(executedLocation, snapRel);
579
+ for(const snapFile of snapshotFiles){
581
580
  let cs;
582
581
  try{ cs = require(snapFile); }catch(_){ continue; }
583
582
  const nameFromPath = path.basename(snapFile).replace(/_contextSnapShot\.json$/i, '').toLowerCase();
584
583
  const ctxName = (cs && cs.contextLocation)
585
584
  ? path.basename(cs.contextLocation).replace(/\.js$/i, '').toLowerCase()
586
585
  : nameFromPath;
587
- const migsRel = globSearch.sync(`**/*_migration.js`, { cwd: cs.migrationFolder, dot: true, windowsPathsNoEscape: true }) || [];
588
- const migs = migsRel.map(f => path.resolve(cs.migrationFolder, f));
586
+ const migs = globSearch.sync(path.join(cs.migrationFolder, '**', '*_migration.js'), cs.migrationFolder) || [];
589
587
  if(!groups[ctxName]) groups[ctxName] = [];
590
588
  groups[ctxName].push({ snapFile, cs, ctxName, migs });
591
589
  }
package/package.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "glob" : "^11.0.3",
6
6
  "deep-object-diff" : "^1.1.9",
7
7
  "pg" : "^8.16.3",
8
- "sync-mysql2" : "^1.0.6",
8
+ "sync-mysql2" : "^1.0.7",
9
9
  "app-root-path": "^3.1.0",
10
10
  "better-sqlite3": "^12.4.1"
11
11
  },
12
- "version": "0.2.13",
12
+ "version": "0.2.16",
13
13
  "description": "An Object-relational mapping for the Master framework. Master Record connects classes to relational database tables to establish a database with almost zero-configuration ",
14
14
  "homepage": "https://github.com/Tailor/MasterRecord#readme",
15
15
  "repository": {