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

You need to sign in or sign up before continuing.
Commit 20c432ca by Dirk Raeder

Using this.quoteIdentifier() to escape attribute names; fixing linting issue.

1 parent a9c51a84
Showing with 9 additions and 9 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 + '`'
}.bind(this)).join(', '),
attributeNamesExport: Utils._.keys(attributes).map(function(attr) {
return '`' + attr + '`'
}.bind(this)).join(', ')
})
tableName: tableName,
attributeNamesImport: Utils._.keys(attributes).map(function(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 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!