Skip to content

Releases: sequelize/sequelize

v3.24.0

11 Aug 15:06
Compare
Choose a tag to compare
  • feat(model): expose model to global hooks (#6371)
  • Backport: Add option to restart identity when truncate (#6417)
  • Use typeof instead of _.isPlainObject (#6416)

First 4.0 pre-release!

28 May 08:17
Compare
Choose a tag to compare
Pre-release

This release marks the first in a long line of pre-releases leading up to the release of the final 4.0 version. Expect at least a couple of months before the final release. To get an idea of the set of BC breaks we plan to introduce, see https://github.com/sequelize/sequelize/issues?q=is%3Aopen+is%3Aissue+milestone%3A4.0 (this list is by no means exhaustive).

Two major things have changed in this release:

Instances are now instanceof their model, instead of being of a separate class

Most notably you can now replace User.build() with new User() and sequelize.define with User extends Sequelize.Model (with the caveat that models defined by extending the Model class must still be attached to the sequelize object via .init). In the future this quirk can most likely be solved by decorators.

Sequelize now only officially supports node v4 and up

This decision has been hard, but we believe that the added features (most notably object literal extensions, template strings and generator coroutines) will be worth the switch. Additionally, cutting down the build matrix and switching coverage from codeclimate to coveralls (which supports parallel coverage jobs - it's awesome) has reduced build time from +30 to < 10 minutes. In the future we will test against the oldest active LTS, and the latest version of node.

Various pre-compilers (babel and typescript) were considered, but we have opted not to have a pre-compilation step. The reason for this is twofold; first of all we want to keep the barrier of entry low for new developers, and secondly we want users to be able to install directly from git, which is not possible if the code requires pre-compilation.

The current stable version has been branched out, and we will continue to accept and releases patches. However, do note that all development time from the core team will go towards 4.0.

This, and all future pre-release, will be published under the unstable tag on npm. This means that npm install sequelize and npm install sequelize@latest will still install v3. To opt into pre-releases use npm install sequelize@unstable or npm install sequelize@4.

What's new in this version (changelog)

  • [FIXED] Pass ResourceLock instead of raw connection in MSSQL disconnect handling
  • [CHANGED] Remove hookValidate in favor of validate with hooks: true | false.
  • [REMOVED] Support for referencesKey
  • [CHANGED] Throw if dialect is not provided to the constructor
  • [CHANGED] Throw bluebird.AggregateError instead of array from bulkCreate when validation fails
  • [FIXED] $notIn: [] is now converted to NOT IN (NULL) #4859
  • [FIXED] Add raw support to instance.get() #5815
  • [ADDED] Compare deletedAt against current timestamp when using paranoid #5880
  • [FIXED] BIGINT gets truncated #5176
  • [FIXED] Trigger afterCreate hook after all nested includes (for hasMany or belongsToMany associations) have been created to be consistent with hasOne.
  • [REMOVED] Support for pool:false
  • [REMOVED] Default transaction isolation level #5094
  • [ADDED] Add logging for mysql warnings, observant of the showWarnings option. #5900
  • [REMOVED] MariaDB dialect
  • [FIXED] hasOne now prefer aliases to construct foreign key #5247
  • [CHANGED] instance.equals now only checks primary keys, instead of all attributes.
  • [REWRITE] Rewrite model and instance to a single class - instance instanceof Model #5924
  • [REMOVED] Counter cache plugin
  • [FIXED] All associations now prefer aliases to construct foreign key #5267
  • [REMOVED] Default transaction auto commit #5094
  • [REMOVED] Callback support for hooks #5228

BC breaks:

  • hookValidate removed in favor of validate with hooks: true | false. validate returns a promise which is rejected if validation fails
  • Removed support for referencesKey, use a references object
  • Remove default dialect
  • When bulkCreate is rejected because of validation failure it throws a bluebird.AggregateError instead of an array. This object is an array-like so length and index access will still work, but instanceof array will not
  • $notIn: [] will now match all rows instead of none
  • (MySQL) BIGINT now gets converted to string when number is too big
  • Removed support for pool:false, if you still want to use single connection set pool.max to 1
  • Removed default REPEATABLE_READ transaction isolation, use config option to explicitly set it
  • Removed MariaDB dialect - this was just a thin wrapper around MySQL, so using dialect: 'mysql' instead should work with no further changes
  • hasOne now prefer as option to generate foreign key name, otherwise it defaults to source model name
  • instance.equals now provides reference equality (do two instances refer to the same row, i.e. are their primary key(s) equal). Use instance.get() to get and compare all values.
  • Instances (database rows) are now instances of the model, instead of being a separate class. This means you can replace User.build() with new User() and sequelize.define with User extends Sequelize.Model. See #5924
  • The counter cache plugin, and consequently the counterCache option for associations has been removed. The plugin is seeking a new maintainer - You can find the code here
  • All associations type will prefer as when constructing the foreignKey name. You can override this by foreignKey option.
  • Removed default AUTO COMMIT for transaction. Its only sent if explicitly set by user or required by dialects (like mysql)
  • Hooks no longer provide a callback - you can return a then-able instead if you are doing async stuff

v3.23.3

26 May 08:42
Compare
Choose a tag to compare
  • [FIXED] Pass ResourceLock instead of raw connection in MSSQL disconnect handling

v3.23.2

15 May 21:07
Compare
Choose a tag to compare
  • [FIXED] Type validation now works with non-strings due to updated validator@5.0.0 #5861
  • [FIXED] Improved offset and limit support for SQL server 2008 #5616
  • [FIXED] options object cloned in all Sequelize methods (so not modified within Sequelize)

v3.23.1

12 May 10:29
Compare
Choose a tag to compare
  • [FIXED] Postgres DECIMAL precision. (PostgreSQL) #4893
  • [FIXED] removeColumn tries to delete non-existant foreign key constraint (mysql) #5808
  • [FIXED] Relation constraints not being applied correctly #5865

v3.23.0

06 May 09:56
Compare
Choose a tag to compare
  • [FIXED] Invalid query generated when using LIKE + ANY #5736
  • [FIXED] Method QueryInterface.bulkDelete no longer working when the model parameter is missing. (PostgreSQL) #5615
  • [ADDED] Context and custom options for deep creation
  • [FIXED] Dates with millisecond precision are inserted correctly in MySQL #5855

3.22.0

26 Apr 06:45
Compare
Choose a tag to compare
  • [FIXED] Fix defaultValues getting overwritten on build
  • [FIXED] Queue queries against tedious connections
  • [ADDED] Enable type validation for all queries (still hidden behind the typeValidation flag)

v3.21.0

04 Apr 07:42
Compare
Choose a tag to compare
  • [FIXED] Confirmed that values modified in validation hooks are preserved #3534
  • [FIXED] Support lower case type names in SQLite #5482
  • [FIXED] Support calling setAssociation twice on hasOne #5315
  • [INTERNALS] Removed dependency on wellknown in favor of terraformer-wkt-parser
  • [ADDED] Benchmarking feature #2494

v3.20.0

21 Mar 15:15
Compare
Choose a tag to compare
  • [ADDED] rejectOnEmpty mode #272 #5480
  • [ADDED] beforeCount hook #5209
  • [ADDED] validationFailed hook #1626
  • [ADDED] Support for IEEE floating point literals in postgres and sqlite #5194
  • [FIXED] addColumn with reference in mysql #5592
  • [FIXED] findAndCountAll generates invalid SQL, subQuery moves to LEFT OUTER JOIN #5445
  • [FIXED] count methods pollute the options.includes #4191
  • [FIXED] Invalid SQL generated when using group option along with attributes #3009
  • [FIXED] Mark index as unique: true when type: 'UNIQUE'. Fixes #5351
  • [FIXED] Improper escaping of bound arrays of strings on Postgres, SQLite, and Microsoft SQL Server

v3.19.3

18 Feb 11:35
Compare
Choose a tag to compare
  • [FIXED] updatedAt and createdAt values are now set before validation #5367
  • [FIXED] describeTable maintains proper enum casing in mysql #5321
  • [FIXED] Parsing of dates in MySQL, when a named timezone is used #4208
  • [FIXED] Truncating in Postgres, when table has a schema #4306
  • [FIXED] Moved initialization of scopes later in the model init process. Fixes attribute exclusion in scopes, #4735 and #4925
  • [FIXED] Multiple custom unique validation messages being overwritten by the first-defined message, #4920