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.
- package/db.js +4 -4
- 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
|
|
598
|
-
throw new TypeError('table, model
|
|
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
|
|
602
|
-
const value = model
|
|
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';
|