mm_mysql 2.2.4 → 2.2.5

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.
Files changed (2) hide show
  1. package/db.js +4 -4
  2. package/package.json +1 -1
package/db.js CHANGED
@@ -594,12 +594,12 @@ DB.prototype.backupTable = function (table, backup, timeout = 60000) {
594
594
  * @return {Promise|Number} 操作结果
595
595
  */
596
596
  DB.prototype.createTable = function (table, model, key = 'id', timeout = 15000) {
597
- if (!table || !model || !model.fields) {
598
- throw new TypeError('table, model, and model.fields must be specified');
597
+ if (!table || !model) {
598
+ throw new TypeError('table, model must be specified');
599
599
  }
600
600
  var fields = '';
601
- for (const field in model.fields) {
602
- const value = model.fields[field];
601
+ for (const field in model) {
602
+ const value = model[field];
603
603
  let type = '';
604
604
  if (field === key) {
605
605
  type = 'INT AUTO_INCREMENT PRIMARY KEY';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_mysql",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "这是超级美眉mysql帮助函数模块,用于便捷操作mysql,使用await方式,可以避免嵌套函数",
5
5
  "main": "index.js",
6
6
  "dependencies": {