@itrocks/mysql-maintainer 0.0.5 → 0.0.6
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/cjs/mysql-maintainer.js
CHANGED
|
@@ -19,6 +19,7 @@ const class_type_1 = require("@itrocks/class-type");
|
|
|
19
19
|
const mysql_to_schema_1 = require("@itrocks/mysql-to-schema");
|
|
20
20
|
const reflect_to_schema_1 = require("@itrocks/reflect-to-schema");
|
|
21
21
|
const schema_diff_1 = require("@itrocks/schema-diff");
|
|
22
|
+
const schema_diff_mysql_1 = require("@itrocks/schema-diff-mysql");
|
|
22
23
|
const store_1 = require("@itrocks/store");
|
|
23
24
|
__exportStar(require("./mysql"), exports);
|
|
24
25
|
class MysqlMaintainer {
|
|
@@ -77,8 +78,10 @@ class MysqlMaintainer {
|
|
|
77
78
|
const mysqlTable = await ((new mysql_to_schema_1.MysqlToTable(this.connection)).convert(tableName));
|
|
78
79
|
console.dir(mysqlTable, { depth: null });
|
|
79
80
|
console.log('table diff:');
|
|
80
|
-
const
|
|
81
|
-
console.dir(
|
|
81
|
+
const schemaDiff = new schema_diff_1.TableDiff(mysqlTable, classTable);
|
|
82
|
+
console.dir(schemaDiff, { depth: null });
|
|
83
|
+
const schemaDiffMysql = new schema_diff_mysql_1.SchemaDiffMysql();
|
|
84
|
+
console.log(schemaDiffMysql.sql(schemaDiff, true));
|
|
82
85
|
return false;
|
|
83
86
|
}
|
|
84
87
|
}
|
package/esm/mysql-maintainer.js
CHANGED
|
@@ -2,6 +2,7 @@ import { typeOf } from '@itrocks/class-type';
|
|
|
2
2
|
import { MysqlToTable } from '@itrocks/mysql-to-schema';
|
|
3
3
|
import { ReflectToTable } from '@itrocks/reflect-to-schema';
|
|
4
4
|
import { TableDiff } from '@itrocks/schema-diff';
|
|
5
|
+
import { SchemaDiffMysql } from '@itrocks/schema-diff-mysql';
|
|
5
6
|
import { storeOf } from '@itrocks/store';
|
|
6
7
|
export * from './mysql';
|
|
7
8
|
export class MysqlMaintainer {
|
|
@@ -60,8 +61,10 @@ export class MysqlMaintainer {
|
|
|
60
61
|
const mysqlTable = await ((new MysqlToTable(this.connection)).convert(tableName));
|
|
61
62
|
console.dir(mysqlTable, { depth: null });
|
|
62
63
|
console.log('table diff:');
|
|
63
|
-
const
|
|
64
|
-
console.dir(
|
|
64
|
+
const schemaDiff = new TableDiff(mysqlTable, classTable);
|
|
65
|
+
console.dir(schemaDiff, { depth: null });
|
|
66
|
+
const schemaDiffMysql = new SchemaDiffMysql();
|
|
67
|
+
console.log(schemaDiffMysql.sql(schemaDiff, true));
|
|
65
68
|
return false;
|
|
66
69
|
}
|
|
67
70
|
}
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"@itrocks/reflect": "latest",
|
|
11
11
|
"@itrocks/reflect-to-schema": "latest",
|
|
12
12
|
"@itrocks/schema-diff": "latest",
|
|
13
|
+
"@itrocks/schema-diff-mysql": "latest",
|
|
13
14
|
"@itrocks/storage": "latest",
|
|
14
15
|
"@itrocks/store": "latest",
|
|
15
16
|
"mariadb": "^3.4"
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"build:esm": "tsc -p tsconfig.esm.json"
|
|
54
55
|
},
|
|
55
56
|
"types": "./esm/mysql-maintainer.d.ts",
|
|
56
|
-
"version": "0.0.
|
|
57
|
+
"version": "0.0.6"
|
|
57
58
|
}
|