Changelog History
Page 2
-
v6.1.0 Changes
June 24, 2020๐ Sequelize v6 is the next major release after v5. Below is a list of breaking changes to help you upgrade.
๐ฅ Breaking Changes
๐ Support for Node 10 and up
๐ Sequelize v6 will only support Node 10 and up #10821.
CLS
๐ฆ You should now use cls-hooked package for CLS support.
const cls = require('cls-hooked');const namespace = cls.createNamespace('....');const Sequelize = require('sequelize');Sequelize.useCLS(namespace);
๐ Database Engine Support
โก๏ธ We have updated our minimum supported database engine versions. Using older database engine will show
SEQUELIZE0006
deprecation warning. Please check ENGINE.md for version table.Sequelize
- ๐จ Bluebird has been removed. Internally all methods are now using async/await. Public API now returns native promises. Thanks to Andy Edwards for this refactor work.
Sequelize.Promise
is no longer available.- ๐
sequelize.import
method has been removed.
Model
options.returning
Option
returning: true
will no longer return attributes that are not defined in the model. Old behavior can be achieved by usingreturning: ['*']
instead.Model.changed()
โ This method now tests for equality with
_.isEqual
and is now deep aware for JSON objects. Modifying a nested value for a JSON object won't mark it as changed (since it is still the same object).const instance = await MyModel.findOne();instance.myJsonField.someProperty = 12345; // Changed from something else to 12345console.log(instance.changed()); // falseawait instance.save(); // this will not save anythinginstance.changed('myJsonField', true);console.log(instance.changed()); // ['myJsonField']await instance.save(); // will save
Model.bulkCreate()
This method now throws
Sequelize.AggregateError
instead ofBluebird.AggregateError
. All errors are now exposed aserrors
key.Model.upsert()
๐ Native upsert is now supported for all dialects.
const [instance, created] = await MyModel.upsert({});
โก๏ธ Signature for this method has been changed to
Promise<Model,boolean | null>
. First index contains upsertedinstance
, second index contains a boolean (ornull
) indicating if record was created or updated. For SQLite/Postgres,created
value will always benull
.- โก๏ธ MySQL - Implemented with ON DUPLICATE KEY UPDATE
- โก๏ธ PostgreSQL - Implemented with ON CONFLICT DO UPDATE
- โก๏ธ SQLite - Implemented with ON CONFLICT DO UPDATE
- ๐ MSSQL - Implemented with MERGE statement
Note for Postgres users: If upsert payload contains PK field, then PK will be used as the conflict target. Otherwise first unique constraint will be selected as the conflict key.
QueryInterface
addConstraint
This method now only takes 2 parameters,
tableName
andoptions
. Previously the second parameter could be a list of column names to apply the constraint to, this list must now be passed asoptions.fields
property.๐ Changelog
6.0.0-beta.7
- ๐ docs(associations): belongs to many create with through table
- ๐ docs(query-interface): fix broken links #12272
- ๐ docs(sequelize): omitNull only works for CREATE/UPDATE queries
- ๐ docs: asyncify #12297
- ๐ docs: responsive #12308
- ๐ docs: update feature request template
- feat(postgres): native upsert #12301
- feat(sequelize): allow passing dialectOptions.options from url #12404
- ๐ fix(include): check if attributes specified for included through model #12316
- ๐ fix(model.destroy): return 0 with truncate #12281
- ๐ fix(mssql): empty order array generates invalid FETCH statement #12261
- ๐ fix(postgres): parse enums correctly when describing a table #12409
- ๐ fix(query): ensure correct return signature for QueryTypes.RAW #12305
- ๐ fix(query): preserve cls context for logger #12328
- ๐ fix(query-generator): do not generate GROUP BY clause if options.group is empty #12343
- ๐ fix(reload): include default scope #12399
- ๐ fix(types): add Association into OrderItem type #12332
- ๐ fix(types): add clientMinMessages to Options interface #12375
- ๐ fix(types): transactionType in Options #12377
- ๐ fix(types): add support for optional values in "where" clauses #12337
- ๐ fix(types): add missing fields to 'FindOrCreateType' #12338
- ๐ fix: add missing sql and parameters properties to some query errors #12299
- ๐ fix: remove custom inspect #12262
- ๐จ refactor: cleanup query generators #12304
6.0.0-beta.6
- ๐ docs(add-constraint): options.fields support
- ๐ docs(association): document uniqueKey for belongs to many #12166
- ๐ docs(association): options.through.where support
- ๐ docs(association): use and instead of 'a nd' #12191
- ๐ docs(association): use correct scope name #12204
- ๐ docs(manuals): avoid duplicate header ids #12201
- ๐ docs(model): correct syntax error in example code #12137
- ๐ docs(query-interface): removeIndex indexNameOrAttributes #11947
- ๐ docs(resources): add sequelize-guard library #12235
- ๐ docs(typescript): fix confusing comments #12226
- ๐ docs(v6-guide): bluebird removal API changes
- ๐ docs: database version support info #12168
- ๐ docs: remove remaining bluebird references #12167
- feat(belongs-to-many): allow creation of paranoid join tables #12088
- feat(belongs-to-many): get/has/count for paranoid join table #12256
- feat(pool): expose maxUses pool config option #12101
- feat(postgres): minify include aliases over limit #11940
- feat(sequelize): handle query string host value #12041
- ๐ fix(associations): ensure correct schema on all generated attributes #12258
- ๐ fix(docs/instances): use correct variable for increment #12087
- ๐ fix(include): separate queries are not sub-queries #12144
- ๐ fix(model): fix unchained promise in association logic in bulkCreate #12163
- ๐ fix(model): updateOnDuplicate handles composite keys #11984
- ๐ fix(model.count): distinct without any column generates invalid SQL #11946
- ๐ fix(model.reload): ignore options.where and always use this.where() #12211
- ๐ fix(mssql) insert record failure because of BOOLEAN column type #12090
- ๐ fix(mssql): cast sql_variant in query generator #11994
- ๐ fix(mssql): dont use OUTPUT INSERTED for update without returning #12260
- ๐ fix(mssql): duplicate order in FETCH/NEXT queries #12257
- ๐ fix(mssql): set correct scale for float #11962
- ๐ fix(mssql): tedious v9 requires connect call #12182
- ๐ fix(mssql): use uppercase for engine table and columns #12212
- ๐ fix(pool): show deprecation when engine is not supported #12218
- ๐ fix(postgres): addColumn support ARRAY(ENUM) #12259
- ๐ fix(query): do not bind $ used within a whole-word #12250
- ๐ fix(query-generator): handle literal for substring based operators #12210
- ๐ fix(query-interface): allow passing null for query interface insert #11931
- ๐ fix(query-interface): allow sequelize.fn and sequelize.literal in fields of IndexesOptions #12224
- ๐ fix(scope): don't modify original scope definition #12207
- ๐ fix(sqlite): multiple primary keys results in syntax error #12237
- ๐ fix(sync): pass options to all query methods #12208
- ๐ fix(typings): add type_helpers to file list #12000
- ๐ fix(typings): correct Model.init return type #12148
- ๐ fix(typings): fn is assignable to where #12040
- ๐ fix(typings): getForeignKeysForTables argument definition #12084
- ๐ fix(typings): make between operator accept date ranges #12162
- ๐จ refactor(ci): improve database wait script #12132
- ๐จ refactor(tsd-test-setup): add & setup dtslint #11879
- ๐จ refactor: move all dialect conditional logic into subclass #12217
- ๐จ refactor: remove sequelize.import helper #12175
- ๐จ refactor: use native versions #12159
- ๐จ refactor: use object spread instead of Object.assign #12213
6.0.0-beta.5
- ๐ fix(find-all): throw on empty attributes #11867
- ๐ fix(types):
queryInterface.addIndex
#11844 - ๐ fix(types):
plain
option insequelize.query
#11596 - ๐ fix(types): correct overloaded method order #11727
- ๐ fix(types):
comparator
arg ofSequelize.where
#11843 - ๐ fix(types): fix BelongsToManyGetAssociationsMixinOptions #11818
- ๐ fix(types): adds
hooks
toCreateOptions
#11736 - ๐ fix(increment): broken queries #11852
- ๐ fix(associations): gets on many-to-many with non-primary target key #11778
- ๐ fix: properly select SRID if present #11763
- feat(sqlite): automatic path provision for
options.storage
#11853 - feat(postgres):
idle_in_transaction_session_timeout
connection option #11775 - ๐ feat(index): improve to support multiple fields with operator #11934
- ๐ docs(transactions): fix addIndex example and grammar #11759
- ๐ docs(raw-queries): remove outdated info #11833
- ๐ docs(optimistic-locking): fix missing manual #11850
- ๐ docs(model): findOne return value for empty result #11762
- ๐ docs(model-querying-basics.md): add some commas #11891
- ๐ docs(manuals): fix missing models-definition page #11838
- ๐ docs(manuals): extensive rewrite #11825
- ๐ docs(dialect-specific): add MSSQL domain auth example #11799
- ๐ docs(associations): fix typos in assocs manual #11888
- ๐ docs(associations): fix typo #11869
6.0.0-beta.4
- ๐ feat(sync): allow to bypass drop statements when sync with alter enabled #11708
- ๐ fix(model): injectDependentVirtualAttrs on included models #11713
- ๐ fix(model): generate ON CONFLICT ... DO UPDATE correctly #11666
- ๐ fix(mssql): optimize formatError RegEx #11725
- ๐ fix(types): add getForeignKeyReferencesForTable type #11738
- ๐ fix(types): add 'restore' hooks to types #11730
- ๐ fix(types): added 'fieldMaps' to QueryOptions typings #11702
- ๐ fix(types): add isSoftDeleted to Model #11628
- ๐ fix(types): fix upsert typing #11674
- ๐ fix(types): specified 'this' for getters and setters in fields #11648
- ๐ fix(types): add paranoid to UpdateOptions interface #11647
- ๐ fix(types): include 'as' in IncludeThroughOptions definition #11624
- ๐ fix(types): add Includeable to IncludeOptions.include type #11622
- ๐ fix(types): transaction lock #11620
- ๐ fix(sequelize.fn): escape dollarsign (#11533) #11606
- ๐ fix(types): add nested to Includeable #11354
- ๐ fix(types): add date to where #11612
- ๐ fix(types): add getDatabaseName (#11431) #11614
- ๐ fix(types): beforeDestroy #11618
- ๐ fix(types): query-interface table schema #11582
- ๐ docs: README.md #11698
- ๐ docs(sequelize): detail options.retry usage #11643
- ๐ docs: clarify logging option in Sequelize constructor #11653
- ๐ docs(migrations): fix syntax error in example #11626
- ๐ docs: describe logging option #11654
- ๐ docs(transaction): fix typo #11659
- ๐ docs(hooks): add info about belongs-to-many #11601
- ๐ docs(associations): fix typo #11592
6.0.0-beta.3
- โ feat: support cls-hooked / tests #11584
6.0.0-beta.2
-
v6.0.0-beta.7
June 24, 2020 -
v6.0.0-beta.6 Changes
May 17, 20206.0.0-beta.6
- ๐ docs(add-constraint): options.fields support
- ๐ docs(association): document uniqueKey for belongs to many #12166
- ๐ docs(association): options.through.where support
- ๐ docs(association): use and instead of 'a nd' #12191
- ๐ docs(association): use correct scope name #12204
- ๐ docs(manuals): avoid duplicate header ids #12201
- ๐ docs(model): correct syntax error in example code #12137
- ๐ docs(query-interface): removeIndex indexNameOrAttributes #11947
- ๐ docs(resources): add sequelize-guard library #12235
- ๐ docs(typescript): fix confusing comments #12226
- ๐ docs(v6-guide): bluebird removal API changes
- ๐ docs: database version support info #12168
- ๐ docs: remove remaining bluebird references #12167
- feat(belongs-to-many): allow creation of paranoid join tables #12088
- feat(belongs-to-many): get/has/count for paranoid join table #12256
- feat(pool): expose maxUses pool config option #12101
- feat(postgres): minify include aliases over limit #11940
- feat(sequelize): handle query string host value #12041
- ๐ fix(associations): ensure correct schema on all generated attributes #12258
- ๐ fix(docs/instances): use correct variable for increment #12087
- ๐ fix(include): separate queries are not sub-queries #12144
- ๐ fix(model): fix unchained promise in association logic in bulkCreate #12163
- ๐ fix(model): updateOnDuplicate handles composite keys #11984
- ๐ fix(model.count): distinct without any column generates invalid SQL #11946
- ๐ fix(model.reload): ignore options.where and always use this.where() #12211
- ๐ fix(mssql) insert record failure because of BOOLEAN column type #12090
- ๐ fix(mssql): cast sql_variant in query generator #11994
- ๐ fix(mssql): dont use OUTPUT INSERTED for update without returning #12260
- ๐ fix(mssql): duplicate order in FETCH/NEXT queries #12257
- ๐ fix(mssql): set correct scale for float #11962
- ๐ fix(mssql): tedious v9 requires connect call #12182
- ๐ fix(mssql): use uppercase for engine table and columns #12212
- ๐ fix(pool): show deprecation when engine is not supported #12218
- ๐ fix(postgres): addColumn support ARRAY(ENUM) #12259
- ๐ fix(query): do not bind $ used within a whole-word #12250
- ๐ fix(query-generator): handle literal for substring based operators #12210
- ๐ fix(query-interface): allow passing null for query interface insert #11931
- ๐ fix(query-interface): allow sequelize.fn and sequelize.literal in fields of IndexesOptions #12224
- ๐ fix(scope): don't modify original scope definition #12207
- ๐ fix(sqlite): multiple primary keys results in syntax error #12237
- ๐ fix(sync): pass options to all query methods #12208
- ๐ fix(typings): add type_helpers to file list #12000
- ๐ fix(typings): correct Model.init return type #12148
- ๐ fix(typings): fn is assignable to where #12040
- ๐ fix(typings): getForeignKeysForTables argument definition #12084
- ๐ fix(typings): make between operator accept date ranges #12162
- ๐จ refactor(ci): improve database wait script #12132
- ๐จ refactor(tsd-test-setup): add & setup dtslint #11879
- ๐จ refactor: move all dialect conditional logic into subclass #12217
- ๐จ refactor: remove sequelize.import helper #12175
- ๐จ refactor: use native versions #12159
- ๐จ refactor: use object spread instead of Object.assign #12213
-
v6.0.0-beta.5
February 20, 2020 -
v6.0.0-beta.4
December 12, 2019 -
v6.0.0-beta.3
October 20, 2019 -
v6.0.0-beta.2
October 19, 2019 -
v5.22.3 Changes
June 30, 2020 -
v5.21.13 Changes
June 14, 2020