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

Commit 98a51363 by Mick Hansen

test: removeColumnQuery with schema

1 parent 0eeefd2a
...@@ -115,8 +115,11 @@ module.exports = (function() { ...@@ -115,8 +115,11 @@ module.exports = (function() {
}, },
removeColumnQuery: function(tableName, attributeName) { removeColumnQuery: function(tableName, attributeName) {
var query = 'ALTER TABLE `<%= tableName %>` DROP `<%= attributeName %>`;'; var query = 'ALTER TABLE <%= tableName %> DROP <%= attributeName %>;';
return Utils._.template(query)({ tableName: tableName, attributeName: attributeName }); return Utils._.template(query)({
tableName: this.quoteTable(tableName),
attributeName: this.quoteIdentifier(attributeName)
});
}, },
changeColumnQuery: function(tableName, attributes) { changeColumnQuery: function(tableName, attributes) {
......
'use strict';
var Support = require(__dirname + '/../support')
, expectsql = Support.expectsql
, current = Support.sequelize
, sql = current.dialect.QueryGenerator
, current = Support.sequelize;
// Notice: [] will be replaced by dialect specific tick/quote character when there is not dialect specific expectation but only a default expectation
suite(Support.getTestDialectTeaser('SQL'), function() {
suite('removeColumn', function () {
test('schema', function () {
expectsql(sql.removeColumnQuery({
schema: 'archive',
tableName: 'user'
}, 'email'), {
default: "ALTER TABLE [archive].[user] DROP COLUMN [email];",
mysql: "ALTER TABLE `archive.user` DROP `email`;"
});
});
});
});
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!