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

Commit 737f3b0d by Sascha Depold

droptable + select

1 parent 5933a39f
Showing with 7 additions and 3 deletions
...@@ -10,8 +10,8 @@ module.exports = (function() { ...@@ -10,8 +10,8 @@ module.exports = (function() {
return query.call(this, this.QueryGenerator.createTableQuery(tableName, attributes, options)) return query.call(this, this.QueryGenerator.createTableQuery(tableName, attributes, options))
} }
QueryInterface.prototype.dropTable = function() { QueryInterface.prototype.dropTable = function(tableName, id) {
return query.call(this, this.QueryGenerator.dropTableQuery(tableName, id))
} }
QueryInterface.prototype.renameTable = function() { QueryInterface.prototype.renameTable = function() {
...@@ -54,12 +54,16 @@ module.exports = (function() { ...@@ -54,12 +54,16 @@ module.exports = (function() {
} }
QueryInterface.prototype.select = function(factory, tableName, options) {
return query.call(this, this.QueryGenerator.selectQuery(tableName, options), factory)
}
// private // private
var query = function() { var query = function() {
var args = Utils._.map(arguments, function(arg, _) { return arg }) var args = Utils._.map(arguments, function(arg, _) { return arg })
// add this as the second argument // add this as callee via the second argument
if(arguments.length == 1) args.push(this) if(arguments.length == 1) args.push(this)
return this.sequelize.query.apply(this.sequelize, args) return this.sequelize.query.apply(this.sequelize, args)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!