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

Commit c65f35e3 by Mick Hansen

just one renameTable query

1 parent 6132bcc5
...@@ -35,8 +35,12 @@ module.exports = (function() { ...@@ -35,8 +35,12 @@ module.exports = (function() {
- originalTableName: Name of the table before execution. - originalTableName: Name of the table before execution.
- futureTableName: Name of the table after execution. - futureTableName: Name of the table after execution.
*/ */
renameTableQuery: function(originalTableName, futureTableName) { renameTableQuery: function(before, after) {
throwMethodUndefined('renameTableQuery') var query = "ALTER TABLE <%= before %> RENAME TO <%= after %>;"
return Utils._.template(query)({
before: this.quoteTable(before),
after: this.quoteTable(after)
})
}, },
/* /*
......
...@@ -99,11 +99,6 @@ module.exports = (function() { ...@@ -99,11 +99,6 @@ module.exports = (function() {
}) })
}, },
renameTableQuery: function(before, after) {
var query = "RENAME TABLE `<%= before %>` TO `<%= after %>`;"
return Utils._.template(query)({ before: before, after: after })
},
showTablesQuery: function() { showTablesQuery: function() {
return 'SHOW TABLES;' return 'SHOW TABLES;'
}, },
......
...@@ -97,14 +97,6 @@ module.exports = (function() { ...@@ -97,14 +97,6 @@ module.exports = (function() {
}) })
}, },
renameTableQuery: function(before, after) {
var query = "ALTER TABLE <%= before %> RENAME TO <%= after %>;"
return Utils._.template(query)({
before: this.quoteIdentifier(before),
after: this.quoteIdentifier(after)
})
},
showTablesQuery: function() { showTablesQuery: function() {
return "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';" return "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';"
}, },
......
...@@ -328,11 +328,6 @@ module.exports = (function() { ...@@ -328,11 +328,6 @@ module.exports = (function() {
return Utils._.template(sql, { tableName: this.addSchema({tableName: tableName, options: options})}) return Utils._.template(sql, { tableName: this.addSchema({tableName: tableName, options: options})})
}, },
renameTableQuery: function(before, after) {
var query = "ALTER TABLE `<%= before %>` RENAME TO `<%= after %>`;"
return Utils._.template(query, { before: before, after: after })
},
removeColumnQuery: function(tableName, attributes) { removeColumnQuery: function(tableName, attributes) {
attributes = this.attributesToSQL(attributes) attributes = this.attributesToSQL(attributes)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!