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

Commit 96a69c2c by sdepold

removed unused code

1 parent beb7bab5
Showing with 7 additions and 17 deletions
...@@ -10,15 +10,11 @@ module.exports = (function() { ...@@ -10,15 +10,11 @@ module.exports = (function() {
QueryInterface.prototype.createTable = function(tableName, attributes, options) { QueryInterface.prototype.createTable = function(tableName, attributes, options) {
var sql = this.QueryGenerator.createTableQuery(tableName, attributes, options) var sql = this.QueryGenerator.createTableQuery(tableName, attributes, options)
, self = this
return queryAndEmit.call(this, sql, 'createTable') return queryAndEmit.call(this, sql, 'createTable')
} }
QueryInterface.prototype.dropTable = function(tableName) { QueryInterface.prototype.dropTable = function(tableName) {
var sql = this.QueryGenerator.dropTableQuery(tableName) var sql = this.QueryGenerator.dropTableQuery(tableName)
, self = this
return queryAndEmit.call(this, sql, 'dropTable') return queryAndEmit.call(this, sql, 'dropTable')
} }
...@@ -51,8 +47,6 @@ module.exports = (function() { ...@@ -51,8 +47,6 @@ module.exports = (function() {
QueryInterface.prototype.renameTable = function(before, after) { QueryInterface.prototype.renameTable = function(before, after) {
var sql = this.QueryGenerator.renameTableQuery(before, after) var sql = this.QueryGenerator.renameTableQuery(before, after)
, self = this
return queryAndEmit.call(this, sql, 'renameTable') return queryAndEmit.call(this, sql, 'renameTable')
} }
...@@ -96,15 +90,12 @@ module.exports = (function() { ...@@ -96,15 +90,12 @@ module.exports = (function() {
var options = Utils.simplifyAttributes(attributes) var options = Utils.simplifyAttributes(attributes)
, sql = this.QueryGenerator.addColumnQuery(tableName, options) , sql = this.QueryGenerator.addColumnQuery(tableName, options)
, self = this
return queryAndEmit.call(this, sql, 'addColumn') return queryAndEmit.call(this, sql, 'addColumn')
} }
QueryInterface.prototype.removeColumn = function(tableName, attributeName) { QueryInterface.prototype.removeColumn = function(tableName, attributeName) {
var sql = this.QueryGenerator.removeColumnQuery(tableName, attributeName) var sql = this.QueryGenerator.removeColumnQuery(tableName, attributeName)
, self = this
return queryAndEmit.call(this, sql, 'removeColumn') return queryAndEmit.call(this, sql, 'removeColumn')
} }
...@@ -118,7 +109,6 @@ module.exports = (function() { ...@@ -118,7 +109,6 @@ module.exports = (function() {
var options = Utils.simplifyAttributes(attributes) var options = Utils.simplifyAttributes(attributes)
, sql = this.QueryGenerator.changeColumnQuery(tableName, options) , sql = this.QueryGenerator.changeColumnQuery(tableName, options)
, self = this
return queryAndEmit.call(this, sql, 'changeColumn') return queryAndEmit.call(this, sql, 'changeColumn')
} }
...@@ -157,7 +147,12 @@ module.exports = (function() { ...@@ -157,7 +147,12 @@ module.exports = (function() {
}).run() }).run()
} }
QueryInterface.prototype.addIndex = function() { QueryInterface.prototype.addIndex = function(tableName, attributes, options) {
var sql = this.QueryGenerator.addIndexQuery(tableName, attributes, options)
return queryAndEmit.call(this, sql, 'addIndex')
}
QueryInterface.prototype.showIndexes = function() {
} }
...@@ -166,8 +161,7 @@ module.exports = (function() { ...@@ -166,8 +161,7 @@ module.exports = (function() {
} }
QueryInterface.prototype.insert = function(model, tableName, values) { QueryInterface.prototype.insert = function(model, tableName, values) {
var self = this var sql = this.QueryGenerator.insertQuery(tableName, values)
, sql = self.QueryGenerator.insertQuery(tableName, values)
return queryAndEmit.call(this, [sql, model], 'insert', { return queryAndEmit.call(this, [sql, model], 'insert', {
success: function(obj) { obj.isNewRecord = false } success: function(obj) { obj.isNewRecord = false }
...@@ -176,15 +170,11 @@ module.exports = (function() { ...@@ -176,15 +170,11 @@ module.exports = (function() {
QueryInterface.prototype.update = function(model, tableName, values, identifier) { QueryInterface.prototype.update = function(model, tableName, values, identifier) {
var sql = this.QueryGenerator.updateQuery(tableName, values, identifier) var sql = this.QueryGenerator.updateQuery(tableName, values, identifier)
, self = this
return queryAndEmit.call(this, [sql, model], 'update') return queryAndEmit.call(this, [sql, model], 'update')
} }
QueryInterface.prototype.delete = function(model, tableName, identifier) { QueryInterface.prototype.delete = function(model, tableName, identifier) {
var sql = this.QueryGenerator.deleteQuery(tableName, identifier) var sql = this.QueryGenerator.deleteQuery(tableName, identifier)
, self = this
return queryAndEmit.call(this, [sql, model], 'delete') return queryAndEmit.call(this, [sql, model], 'delete')
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!