masterrecord 0.2.3 → 0.2.4
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 +11 -1
- package/package.json +1 -1
package/Migrations/cli.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// version 0.0.
|
|
3
|
+
// version 0.0.6
|
|
4
4
|
// https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/
|
|
5
5
|
// how to add environment variables on cli call example - master=development masterrecord add-migration auth authContext
|
|
6
6
|
|
|
7
7
|
const { program } = require('commander');
|
|
8
8
|
let fs = require('fs');
|
|
9
9
|
let path = require('path');
|
|
10
|
+
const Module = require('module');
|
|
11
|
+
// Alias require('masterrecord') to this global package so project files don't need a local install
|
|
12
|
+
const __MASTERRECORD_ROOT__ = path.join(__dirname, '..');
|
|
13
|
+
const __ORIGINAL_REQUIRE__ = Module.prototype.require;
|
|
14
|
+
Module.prototype.require = function(request) {
|
|
15
|
+
if (request === 'masterrecord') {
|
|
16
|
+
return __ORIGINAL_REQUIRE__.call(this, __MASTERRECORD_ROOT__);
|
|
17
|
+
}
|
|
18
|
+
return __ORIGINAL_REQUIRE__.call(this, request);
|
|
19
|
+
};
|
|
10
20
|
var Migration = require('./migrations');
|
|
11
21
|
var globSearch = require("glob");
|
|
12
22
|
const pkg = require(path.join(__dirname, '..', 'package.json'));
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"sync-mysql2" : "^1.0.6",
|
|
9
9
|
"app-root-path": "^3.1.0"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.4",
|
|
12
12
|
"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 ",
|
|
13
13
|
"homepage": "https://github.com/Tailor/MasterRecord#readme",
|
|
14
14
|
"repository": {
|