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 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
  *
@@ -54,7 +54,6 @@ exports.default = (function (_ref) {
54
54
  }
55
55
  finally { if (e_1) throw e_1.error; }
56
56
  }
57
- process.exit(0);
58
57
  }
59
58
  catch (err) {
60
59
  console.log(err.message);
@@ -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
- try {
12
- fs.accessSync(cwd + "/".concat(file), fs.F_OK, {
13
- recursive: true
14
- });
15
- }
16
- catch (e) {
17
- fs.mkdirSync(cwd + "/".concat(file), {
18
- recursive: true
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, "/").concat(file).concat(type);
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)
@@ -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 (name == null) {
10
- console.log("use ".concat(npm, " make:table FOLDER/FOLDER --name=tableName"));
11
- process.exit(0);
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tspace-mysql",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "mysql query builder object relational mapping",
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.ts",