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

Commit 86482746 by Mick Hansen

Merge pull request #1983 from db6edr/fix-sqlite-rename-column-fails

renameColumnQuery returns quoted column name (for branch 1.7.0)
2 parents 77dbded7 22913188
Showing with 4 additions and 4 deletions
......@@ -379,17 +379,17 @@ module.exports = (function() {
this.createTableQuery(tableName, attributes),
"INSERT INTO <%= tableName %> SELECT <%= attributeNamesExport %> FROM <%= tableName %>_backup;",
"DROP TABLE <%= tableName %>_backup;"
].join("")
].join("");
return Utils._.template(query, {
tableName: tableName,
attributeNamesImport: Utils._.keys(attributes).map(function(attr) {
return (attrNameAfter === attr) ? attrNameBefore + ' AS ' + attr : attr
return (attrNameAfter === attr) ? this.quoteIdentifier(attrNameBefore) + ' AS ' + this.quoteIdentifier(attr) : this.quoteIdentifier(attr);
}.bind(this)).join(', '),
attributeNamesExport: Utils._.keys(attributes).map(function(attr) {
return attr
return this.quoteIdentifier(attr);
}.bind(this)).join(', ')
})
});
},
startTransactionQuery: function(options) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!