masterrecord 0.2.13 → 0.2.14
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 +3 -5
- package/package.json +1 -1
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(
|
|
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
|
|
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
|
|
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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"app-root-path": "^3.1.0",
|
|
10
10
|
"better-sqlite3": "^12.4.1"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.2.
|
|
12
|
+
"version": "0.2.14",
|
|
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": {
|