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

Commit 1459d4a2 by Jeff French

Update sqlite addColumn function to handle enums.

1 parent 7849eda0
Showing with 18 additions and 2 deletions
......@@ -155,8 +155,24 @@ module.exports = (function() {
return query;
},
addColumnQuery: function() {
var sql = MySqlQueryGenerator.addColumnQuery.apply(this, arguments);
addColumnQuery: function(table, key, dataType) {
var query = 'ALTER TABLE <%= table %> ADD <%= attribute %>;'
, attributes = {};
attributes[key] = dataType;
var fields = this.attributesToSQL(attributes, {
context: 'addColumn'
});
var attribute = Utils._.template('<%= key %> <%= definition %>')({
key: this.quoteIdentifier(key),
definition: fields[key]
});
var sql = Utils._.template(query)({
table: this.quoteTable(table),
attribute: attribute
});
return this.replaceBooleanDefaults(sql);
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!