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

Commit 8e583002 by Sascha Depold

Merge branch 'master' of github.com:sequelize/sequelize

2 parents e3b7db2e dbfe8a79
......@@ -377,7 +377,7 @@ module.exports = (function() {
}, options || {})
return Utils._.compact([
"CREATE", options.indicesType, "INDEX", options.indexName,
"CREATE", options.indicesType, "INDEX IF NOT EXISTS", options.indexName,
(options.indexType ? ('USING ' + options.indexType) : undefined),
"ON", tableName, '(' + transformedAttributes.join(', ') + ')',
(options.parser ? "WITH PARSER " + options.parser : undefined)
......
......@@ -378,7 +378,7 @@ module.exports = (function() {
},
removeIndexQuery: function(tableName, indexNameOrAttributes) {
var sql = "DROP INDEX <%= indexName %>"
var sql = "DROP INDEX IF EXISTS <%= indexName %>"
, indexName = indexNameOrAttributes
if (typeof indexName !== 'string') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!