不要怂,就是干,撸起袖子干!

Commit 1afa4bb1 by Michael Pauley

Add options.autoIncrement to MySQL

The initial AUTO_INCREMENT value for the table.
1 parent 10b93eab
Showing with 3 additions and 2 deletions
......@@ -29,7 +29,7 @@ module.exports = (function() {
var self = this;
var query = 'CREATE TABLE IF NOT EXISTS <%= table %> (<%= attributes%>)<%= comment %> ENGINE=<%= engine %> <%= charset %> <%= collation %>'
var query = 'CREATE TABLE IF NOT EXISTS <%= table %> (<%= attributes%>)<%= comment %> ENGINE=<%= engine %> <%= charset %> <%= collation %> <%= initialAutoIncrement %>'
, primaryKeys = []
, foreignKeys = {}
, attrStr = [];
......@@ -67,7 +67,8 @@ module.exports = (function() {
comment: options.comment && Utils._.isString(options.comment) ? ' COMMENT ' + this.escape(options.comment) : '',
engine: options.engine,
charset: (options.charset ? 'DEFAULT CHARSET=' + options.charset : ''),
collation: (options.collate ? 'COLLATE ' + options.collate : '')
collation: (options.collate ? 'COLLATE ' + options.collate : ''),
initialAutoIncrement: (options.initialAutoIncrement ? 'AUTO_INCREMENT=' + options.initialAutoIncrement : '')
}
, pkString = primaryKeys.map(function(pk) { return this.quoteIdentifier(pk); }.bind(this)).join(', ');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!