masterrecord 0.0.46 → 0.0.47
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 +2 -3
- package/Migrations/migrations.js +7 -2
- package/package.json +1 -2
- package/readme.md +1 -1
package/Migrations/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// version 0.0.
|
|
3
|
+
// version 0.0.s
|
|
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
|
|
|
@@ -15,8 +15,7 @@ const [,, ...args] = process.argv
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
program
|
|
18
|
-
.version('0.0.2')
|
|
19
|
-
.option('-v, --version', '0.0.34')
|
|
18
|
+
.version('0.0.2', '-v, --version', '0.0.2')
|
|
20
19
|
.description('A ORM framework that facilitates the creation and use of business objects whose data requires persistent storage to a database');
|
|
21
20
|
|
|
22
21
|
// Instructions : to run command you must go to main project folder is located and run the command using the context file name.
|
package/Migrations/migrations.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// version 0.0.
|
|
1
|
+
// version 0.0.8
|
|
2
2
|
// learn more about seeding info - https://www.pauric.blog/Database-Updates-and-Migrations-with-Entity-Framework/
|
|
3
3
|
|
|
4
4
|
var fs = require('fs');
|
|
@@ -164,6 +164,12 @@ class Migrations{
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
createSnapShot(snap){
|
|
167
|
+
|
|
168
|
+
var dbFolder = `${snap.executedLocation}/db`;
|
|
169
|
+
if (!fs.existsSync(dbFolder)){
|
|
170
|
+
fs.mkdirSync(dbFolder);
|
|
171
|
+
}
|
|
172
|
+
|
|
167
173
|
var migrationsDirectory = `${snap.executedLocation}/db/migrations`;
|
|
168
174
|
if (!fs.existsSync(migrationsDirectory)){
|
|
169
175
|
fs.mkdirSync(migrationsDirectory);
|
|
@@ -222,7 +228,6 @@ class Migrations{
|
|
|
222
228
|
}
|
|
223
229
|
|
|
224
230
|
template(name, oldSchema, newSchema){
|
|
225
|
-
|
|
226
231
|
var MT = new MigrationTemplate(name);
|
|
227
232
|
var tables = this.#buildMigrationObject(oldSchema, newSchema);
|
|
228
233
|
tables.forEach(function (item, index) {
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "masterrecord",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"better-sqlite3": "^9.0.0",
|
|
5
4
|
"commander": "^11.1.0",
|
|
6
5
|
"glob" : "^10.3.10",
|
|
7
6
|
"deep-object-diff" : "^1.1.9",
|
|
8
7
|
"pg" : "^8.13.3",
|
|
9
8
|
"mysql" : "^2.18.1"
|
|
10
9
|
},
|
|
11
|
-
"version": "0.0.
|
|
10
|
+
"version": "0.0.47",
|
|
12
11
|
"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
12
|
"homepage": "https://github.com/Tailor/MasterRecord#readme",
|
|
14
13
|
"repository": {
|
package/readme.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
local install of CLI package run code in terminal - "npm install -g ./"
|
|
1
|
+
local install of CLI package run code in terminal - "npm install -g ./" master
|