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

Commit 5ba4565c by Ruben Bridgewater Committed by Jan Aagaard Meier

Rename ignore into ignoreDuplicates (#6214)

1 parent 05a02f7c
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
- [REMOVED] `classMethods` and `instanceMethods` [#5869](https://github.com/sequelize/sequelize/issues/5869#issuecomment-221773485) - [REMOVED] `classMethods` and `instanceMethods` [#5869](https://github.com/sequelize/sequelize/issues/5869#issuecomment-221773485)
- [CHANGED] `Sequelize.Validator` is now an independent copy of `validator` library - [CHANGED] `Sequelize.Validator` is now an independent copy of `validator` library
- [FIXED] Don't patch `validator` library globally [#6196](https://github.com/sequelize/sequelize/issues/6196) - [FIXED] Don't patch `validator` library globally [#6196](https://github.com/sequelize/sequelize/issues/6196)
- [CHANGED] `ignore` for create was renamed to `ignoreDuplicates` [#6138](https://github.com/sequelize/sequelize/issues/6138)
## BC breaks: ## BC breaks:
- Range type bounds now default to [postgres default](https://www.postgresql.org/docs/9.5/static/rangetypes.html#RANGETYPES-CONSTRUCT) `[)` (inclusive, exclusive), previously was `()` (exclusive, exclusive) - Range type bounds now default to [postgres default](https://www.postgresql.org/docs/9.5/static/rangetypes.html#RANGETYPES-CONSTRUCT) `[)` (inclusive, exclusive), previously was `()` (exclusive, exclusive)
...@@ -26,6 +27,7 @@ ...@@ -26,6 +27,7 @@
- Sequelize uses an independent copy of `bluebird` library. This means (1) promises returned from Sequelize methods are instances of `Sequelize.Promise` but not global `Bluebird` and (2) the CLS patch does not affect global `Bluebird`. - Sequelize uses an independent copy of `bluebird` library. This means (1) promises returned from Sequelize methods are instances of `Sequelize.Promise` but not global `Bluebird` and (2) the CLS patch does not affect global `Bluebird`.
- Dropped support for `classMethods` and `instanceMethods`. As Models are now ES6 classes `classMethods` can be directly assigned and `instanceMethods` should be added to `Model.prototype` - Dropped support for `classMethods` and `instanceMethods`. As Models are now ES6 classes `classMethods` can be directly assigned and `instanceMethods` should be added to `Model.prototype`
- `Sequelize.Validator` is now a cloned version of `validator`, It will not pollute global library methods. - `Sequelize.Validator` is now a cloned version of `validator`, It will not pollute global library methods.
- `ignore` for create was renamed to `ignoreDuplicates`
# 4.0.0-0 # 4.0.0-0
- [FIXED] Pass ResourceLock instead of raw connection in MSSQL disconnect handling - [FIXED] Pass ResourceLock instead of raw connection in MSSQL disconnect handling
......
...@@ -177,8 +177,8 @@ const QueryGenerator = { ...@@ -177,8 +177,8 @@ const QueryGenerator = {
const fields = []; const fields = [];
const values = []; const values = [];
let query; let query;
let valueQuery = '<%= tmpTable %>INSERT<%= ignore %> INTO <%= table %> (<%= attributes %>)<%= output %> VALUES (<%= values %>)'; let valueQuery = '<%= tmpTable %>INSERT<%= ignoreDuplicates %> INTO <%= table %> (<%= attributes %>)<%= output %> VALUES (<%= values %>)';
let emptyQuery = '<%= tmpTable %>INSERT<%= ignore %> INTO <%= table %><%= output %>'; let emptyQuery = '<%= tmpTable %>INSERT<%= ignoreDuplicates %> INTO <%= table %><%= output %>';
let outputFragment; let outputFragment;
let identityWrapperRequired = false; let identityWrapperRequired = false;
let tmpTable = ''; //tmpTable declaration for trigger let tmpTable = ''; //tmpTable declaration for trigger
...@@ -287,7 +287,7 @@ const QueryGenerator = { ...@@ -287,7 +287,7 @@ const QueryGenerator = {
} }
const replacements = { const replacements = {
ignore: options.ignore ? this._dialect.supports.IGNORE : '', ignoreDuplicates: options.ignoreDuplicates ? this._dialect.supports.IGNORE : '',
table: this.quoteTable(table), table: this.quoteTable(table),
attributes: fields.join(','), attributes: fields.join(','),
output: outputFragment, output: outputFragment,
......
...@@ -98,7 +98,7 @@ const QueryGenerator = { ...@@ -98,7 +98,7 @@ const QueryGenerator = {
}, },
upsertQuery(tableName, insertValues, updateValues, where, rawAttributes, options) { upsertQuery(tableName, insertValues, updateValues, where, rawAttributes, options) {
options.ignore = true; options.ignoreDuplicates = true;
const sql = this.insertQuery(tableName, insertValues, rawAttributes, options) + ' ' + this.updateQuery(tableName, updateValues, where, options, rawAttributes); const sql = this.insertQuery(tableName, insertValues, rawAttributes, options) + ' ' + this.updateQuery(tableName, updateValues, where, options, rawAttributes);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!