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

Commit f1d2f054 by Daniel Durante

sqlite and mysql will now dropSchemas (tables) correctly.

1 parent ff57af63
......@@ -386,4 +386,4 @@ module.exports = (function() {
}
return ConnectorManager
})()
})()
\ No newline at end of file
......@@ -29,9 +29,8 @@ module.exports = (function() {
return Utils._.template(query)({})
},
dropSchema: function() {
var query = "SHOW TABLES"
return Utils._.template(query)({})
dropSchema: function(tableName, options) {
return QueryGenerator.dropTableQuery(tableName, options)
},
showSchemasQuery: function() {
......
......@@ -37,9 +37,8 @@ module.exports = (function() {
return Utils._.template(query)({})
},
dropSchema: function() {
var query = "SELECT name FROM sqlite_master WHERE type='table' and name!='sqlite_sequence';"
return Utils._.template(query)({})
dropSchema: function(tableName, options) {
return this.dropTableQuery(tableName, options)
},
showSchemasQuery: function() {
......@@ -89,6 +88,16 @@ module.exports = (function() {
return this.replaceBooleanDefaults(sql)
},
dropTableQuery: function(tableName, options) {
options = options || {}
var query = "DROP TABLE IF EXISTS <%= table %>;"
return Utils._.template(query)({
table: this.quoteIdentifier(tableName)
})
},
addColumnQuery: function() {
var sql = MySqlQueryGenerator.addColumnQuery.apply(this, arguments)
return this.replaceBooleanDefaults(sql)
......@@ -134,6 +143,7 @@ module.exports = (function() {
return Utils._.template(query)(replacements)
},
selectQuery: function(tableName, options) {
var table = null,
joinQuery = ""
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!