tspace-mysql 1.0.3 → 1.0.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/README.md +2 -0
- package/dist/cli/migrate/make.js +0 -1
- package/dist/cli/models/make.js +12 -10
- package/dist/cli/tables/make.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -326,6 +326,8 @@ import { Schema , Blueprint , DB } from 'tspace-mysql'
|
|
|
326
326
|
email : new Blueprint().varchar(255).unique(),
|
|
327
327
|
email_verify : new Blueprint().tinyInt(),
|
|
328
328
|
password : new Blueprint().varchar(255),
|
|
329
|
+
created_at : new Blueprint().null().timestamp(),
|
|
330
|
+
updated_at : new Blueprint().null().timestamp()
|
|
329
331
|
})
|
|
330
332
|
/**
|
|
331
333
|
*
|
package/dist/cli/migrate/make.js
CHANGED
package/dist/cli/models/make.js
CHANGED
|
@@ -8,17 +8,19 @@ var table_1 = __importDefault(require("../tables/table"));
|
|
|
8
8
|
var pluralize_1 = __importDefault(require("pluralize"));
|
|
9
9
|
exports.default = (function (_ref) {
|
|
10
10
|
var file = _ref.file, migrate = _ref.migrate, dir = _ref.dir, type = _ref.type, cwd = _ref.cwd, fs = _ref.fs, npm = _ref.npm;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
if (dir) {
|
|
12
|
+
try {
|
|
13
|
+
fs.accessSync(cwd + "/".concat(dir), fs.F_OK, {
|
|
14
|
+
recursive: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
fs.mkdirSync(cwd + "/".concat(dir), {
|
|
19
|
+
recursive: true
|
|
20
|
+
});
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
|
-
var model = dir ? "".concat(cwd, "/").concat(dir, "/").concat(file).concat(type) : "".concat(cwd, "/").concat(file
|
|
23
|
+
var model = dir ? "".concat(cwd, "/").concat(dir, "/").concat(file).concat(type) : "".concat(cwd, "/").concat(file).concat(type);
|
|
22
24
|
var data = (0, model_1.default)(file, npm);
|
|
23
25
|
fs.writeFile(model, data, function (err) {
|
|
24
26
|
if (err)
|
package/dist/cli/tables/make.js
CHANGED
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var table_1 = __importDefault(require("./table"));
|
|
7
7
|
exports.default = (function (_ref) {
|
|
8
8
|
var file = _ref.file, name = _ref.name, type = _ref.type, cwd = _ref.cwd, dir = _ref.dir, fs = _ref.fs, npm = _ref.npm;
|
|
9
|
-
if
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
9
|
+
// if(name == null) {
|
|
10
|
+
// console.log(`use ${npm} make:migration <NAME TABLE> --dir=<DIRECTORY>`)
|
|
11
|
+
// process.exit(0);
|
|
12
|
+
// }
|
|
13
13
|
try {
|
|
14
14
|
fs.accessSync(cwd + "/".concat(file), fs.F_OK, {
|
|
15
15
|
recursive: true
|