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

Commit cfef3366 by Michael Kearns

Fix removeColumnQuery for mssql dialect

* As per the syntax tree at:

  https://msdn.microsoft.com/en-gb/library/ms190273.aspx

  the correct syntax for removing a column is:
    ALTER TABLE users DROP COLUMN name;
  instead of:
    ALTER TABLE users DROP name;
  which is instead the syntax to drop the 'name' constraint.
1 parent c9c00b45
......@@ -170,7 +170,7 @@ var QueryGenerator = {
},
removeColumnQuery: function(tableName, attributeName) {
var query = 'ALTER TABLE <%= tableName %> DROP <%= attributeName %>;';
var query = 'ALTER TABLE <%= tableName %> DROP COLUMN <%= attributeName %>;';
return Utils._.template(query)({
tableName: this.quoteTable(tableName),
attributeName: this.quoteIdentifier(attributeName)
......
......@@ -15,7 +15,7 @@ if (current.dialect.name !== 'sqlite') {
schema: 'archive',
tableName: 'user'
}, 'email'), {
mssql: 'ALTER TABLE [archive].[user] DROP [email];',
mssql: 'ALTER TABLE [archive].[user] DROP COLUMN [email];',
mysql: 'ALTER TABLE `archive.user` DROP `email`;',
postgres: 'ALTER TABLE "archive"."user" DROP COLUMN "email";',
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!