masterrecord 0.3.19 → 0.3.20
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.
|
@@ -14,21 +14,21 @@ class MigrationTemplate {
|
|
|
14
14
|
#down = ''
|
|
15
15
|
|
|
16
16
|
get(){
|
|
17
|
-
return `
|
|
18
|
-
|
|
17
|
+
return `
|
|
18
|
+
|
|
19
19
|
var masterrecord = require('masterrecord');
|
|
20
20
|
|
|
21
|
-
class ${this.name} extends masterrecord.schema {
|
|
21
|
+
class ${this.name} extends masterrecord.schema {
|
|
22
22
|
constructor(context){
|
|
23
23
|
super(context);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
up(table){
|
|
26
|
+
async up(table){
|
|
27
27
|
this.init(table);
|
|
28
28
|
${this.#up}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
down(table){
|
|
31
|
+
async down(table){
|
|
32
32
|
this.init(table);
|
|
33
33
|
${this.#down}
|
|
34
34
|
}
|
|
@@ -47,10 +47,10 @@ module.exports = ${this.name};
|
|
|
47
47
|
}
|
|
48
48
|
createTable(type, name){
|
|
49
49
|
if(type === "up"){
|
|
50
|
-
this.#up += os.EOL + ` this.createTable(table.${name});`
|
|
50
|
+
this.#up += os.EOL + ` await this.createTable(table.${name});`
|
|
51
51
|
}
|
|
52
52
|
else{
|
|
53
|
-
this.#down += os.EOL + ` this.createTable(table.${name});`
|
|
53
|
+
this.#down += os.EOL + ` await this.createTable(table.${name});`
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -66,10 +66,10 @@ module.exports = ${this.name};
|
|
|
66
66
|
|
|
67
67
|
dropTable(type, name){
|
|
68
68
|
if(type === "up"){
|
|
69
|
-
this.#down += os.EOL + ` this.
|
|
69
|
+
this.#down += os.EOL + ` this.dropTable(table.${name});`
|
|
70
70
|
}
|
|
71
71
|
else{
|
|
72
|
-
this.#down += os.EOL + ` this.
|
|
72
|
+
this.#down += os.EOL + ` this.dropTable(table.${name});`
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "masterrecord",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"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 ",
|
|
5
5
|
"main": "MasterRecord.js",
|
|
6
6
|
"bin": {
|