@axiosleo/orm-mysql 0.12.0 → 0.12.1

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/bin/orm-mysql.js CHANGED
@@ -9,7 +9,7 @@ const app = new App({
9
9
  name: 'MySQL ORM CLI',
10
10
  desc: 'migrate, model, seed, etc.',
11
11
  bin: 'orm-mysql',
12
- version: '0.12.0',
12
+ version: '0.12.1',
13
13
  commands_dir: path.join(__dirname, '../commands'),
14
14
  });
15
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiosleo/orm-mysql",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "MySQL ORM tool",
5
5
  "keywords": [
6
6
  "mysql",
package/src/builder.js CHANGED
@@ -710,7 +710,7 @@ class ManageSQLBuilder extends Builder {
710
710
  let str = `\`${options.name}\` ${type}`;
711
711
  if (typeof options.length !== 'undefined') {
712
712
  if (type === 'DECIMAL') {
713
- str += `(${options.length}, ${options.precision || 6})`;
713
+ str += `(${options.precision || 10}, ${options.length || 6})`;
714
714
  } else {
715
715
  str += `(${options.length})`;
716
716
  }
@@ -721,7 +721,7 @@ class ManageSQLBuilder extends Builder {
721
721
  } else if (type === 'TINYINT') {
722
722
  str += '(4)';
723
723
  } else if (type === 'DECIMAL') {
724
- str += '(10, 6)';
724
+ str += `(${options.precision || 10}, ${options.length || 6})`;
725
725
  }
726
726
  if (options.allowNull === false || options.primaryKey === true) {
727
727
  str += ' NOT NULL';