diff --git a/lib/mysql.js b/lib/mysql.js index 1732dda..ad56c3c 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -726,6 +726,7 @@ MySQL.prototype.alterTable = function (model, actualFields, actualIndexes, done, MySQL.prototype.propertiesSQL = function (model) { var self = this; var sql; + var tableOptions = []; if (this.schema.settings.slave) { sql = ['`id` VARCHAR(100) NOT NULL PRIMARY KEY']; } else { @@ -750,7 +751,13 @@ MySQL.prototype.propertiesSQL = function (model) { sql.push(self.indexSettingsSQL(model, prop)); }); } - return sql.join(',\n '); + + var engine = this._models[model].settings.engine; + if (engine) { + tableOptions.push('ENGINE '+engine); + } + + return ' (\n ' + sql.join(',\n ') + '\n) '+tableOptions.join(',\n '); }; MySQL.prototype.singleIndexSettingsSQL = function (model, prop) {