Notice: All 1.7.x changes are present in 2.0.x aswell
- [FEATURE] You can now return a promise to a hook rather than use a callback
- [FEATURE] There is now basic support for assigning a field name to an attribute
name: {type: DataTypes.STRING, field: 'full_name'}
- [FEATURE] It's now possible to add multiple relations to a hasMany association, modelInstance.addRelations([otherInstanceA, otherInstanceB])
- [FEATURE]
define()
stores models insequelize.models
Object e.g.sequelize.models.MyModel
- [FEATURE] The
set
/add
/has
methods for associations now allow you to pass the value of a primary key, instead of a full Instance object, like so:user.addTask(15);
. - [FEATURE] Support for FOR UPDATE and FOR SHARE statements #1777
- [FEATURE] n:m createAssocation now returns the target model instance instead of the join model instance
- [FEATURE] Extend the
foreignKey
option for associations to support a full data type definition, and not just a string - [FEATURE] Extract CLI into separate projects.
- [FEATURE] Sqlite now inserts dates with millisecond precision
- [FEATURE] Sequelize.VIRTUAL datatype which provides regular attribute functionality (set, get, etc) but never persists to database.
- [BUG] An error is now thrown if an association would create a naming conflict between the association and the foreign key when doing eager loading. Closes #1272
- [BUG] Fix logging options for sequelize.sync
- [BUG] find no longer applies limit: 1 if querying on a primary key, should fix a lot of subquery issues.
- [BUG] Transactions now use the pool so you will never go over your pool defined connection limit
- [BUG] Fix use of Sequelize.literal in eager loading and when renaming attributes #1916
- [BUG] Use the provided name for a unique index if one is given, instead of concating the column names together #1944
- [INTERNALS]
bulkDeleteQuery
was removed from the MySQL / abstract query generator, since it was never used internally. Please usedeleteQuery
instead.
- Sequelize now returns promises instead of its custom event emitter from most calls. This affects methods that return multiple values (like
findOrCreate
orfindOrInitialize
). If your current callbacks do not accept the 2nd success parameter you might be seeing an array as the first param. Either use.spread()
for these methods or add another argument to your callback:.success(instance)
->.success(instance, created)
. .success()
/.done()
and any other non promise methods are now deprecated (we will keep the codebase around for a few versions though). on('sql') persists for debugging purposes.- Model association calls (belongsTo/hasOne/hasMany) are no longer chainable. (this is to support being able to pass association references to include rather than model/as combinations)
QueryInterface
no longer emits global events. This means you can no longer do things likeQueryInterface.on('showAllSchemas', function ...
sequelize.showAllSchemas
now returns an array of schemas, instead of an array containinig an array of schemassequelize.transaction()
now returns a promise rather than a instance of Sequelize.TransactionbulkCreate
,bulkUpdate
andbulkDestroy
(and aliases) now take both ahooks
and anindividualHooks
option,hooks
defines whether or not to run the main hooks, andindividualHooks
defines whether to run hooks for each instance affected.- It is no longer possible to disable pooling, disable pooling will just result in a 1/1 pool.
- [PERFORMANCE] increased build performance when using include, which speeds up findAll etc.
- [BUG] Made it possible to use HSTORE both in attribute: HSTORE and attribute: { type: HSTORE } form. Thanks to @tomchentw #1458
- [FEATURE] n:m now marks the columns of the through table as foreign keys and cascades them on delete and update by default.
- [FEATURE] 1:1 and 1:m marks columns as foreign keys, and sets them to cascade on update and set null on delete. If you are working with an existing DB which does not allow null values, be sure to override those options, or disable them completely by passing constraints: false to your assocation call (
M1.belongsTo(M2, { constraints: false})
). - [BUG] Removed the hard dependency on pg, allowing users to use pg.js
- [BUG] Fixed a bug with foreign keys pointing to attributes that were not integers. Now your primaryKey can be a string, and associations will still work. Thanks to @fixe #1544
- [BUG] Fix a case where createdAt timestamp would not be set when updatedAt was disabled Thanks to @fixe #1543
- [BUG] Fix a case where timestamps were not being write protected in
set
when underscored=true. janmeier #1523 - [FEATURE/BUG] Prefetching/includes now fully support schemas
- [FEATURE] Centralize logging. #1566
- [FEATURE/BUG] hstore values are now parsed on find/findAll. Thanks to @nunofgs #1560
- [FEATURE] Read cli options from a file. Thanks to @codeinvain #1540
- The
notNull
validator has been removed, use the Schema'sallowNull
property. - All Validation errors now return a sequelize.ValidationError which inherits from Error.
- selectedValues has been removed for performance reasons, if you depend on this, please open an issue and we will help you work around it.
- foreign keys will now correctly be based on the alias of the model
- if you have any 1:1 relations where both sides use an alias, you'll need to set the foreign key, or they'll each use a different foreign key based on their alias.
- foreign keys for non-id primary keys will now be named for the foreign key, i.e. pub_name rather than pub_id
- if you have non-id primary keys you should go through your associations and set the foreignKey option if relying on a incorrect _id foreign key
- syncOnAssocation has been removed. It only worked for n:m, and having a synchronous function (hasMany) that invokes an asynchronous function (sync) without returning an emitter does not make a lot of sense. If you (implicitly) depended on this feature, sequelize.sync is your friend. If you do not want to do a full sync, use custom through models for n:m (
M1.hasMany(M2, { through: M3})
) and sync the through model explicitly. - Join tables will be no longer be paranoid (have a deletedAt timestamp added), even though other models are.
- All tables in select queries will now be aliased with the model names to be support schemas. This will affect people stuff like `where: {'table.attribute': value}
- [BUG] fixes issue with custom primary keys and N:M join tables #1929
- [FEATURE] adds rlike support for mysql
- [BUG] fixes issue where count/findAndCountAll would throw on empty rows #1849
- [BUG] fixes issue where primary key is also foreign key #1818
- [BUG] fixes bug with some methods relying on table information throwing strange errors #1686
- [BUG] fixes foreign key types for hasMany
- [BUG] fixes transactions support for 1-to-1 association setters.
- [BUG] fixes issue where relations would not use transactions probably in adders/setters.
- [FEATURE] covers more advanced include cases with limiting and filtering (specifically cases where a include would be in the subquery but its child include wouldnt be, for cases where a 1:1 association had a 1:M association as a nested include)
- [BUG] fixes issue where connection would timeout before calling COMMIT resulting in data never reaching the database #1429
- [PERFORMANCE] fixes performance regression introduced in rc7
- [FEATURE] include all relations for a model #1421
- [BUG] N:M adder/getter with through model and custom primary keys now work
- [BUG] fixes bug with required includes without wheres with subqueries
- [BUG] ORDER BY statements when using includes should now be places in the appropriate sub/main query more intelligently.
- [BUG] using include.attributes with primary key attributes specified should no longer result in multiple primary key attributes being selected #1410
- [DEPENDENCIES] all dependencies, including Validator have been updated to the latest versions.
- .set() will no longer set values that are not a dynamic setter or defined in the model. This only breaks BC since .set() was introduced but restores original .updateAttributes functionality where it was possible to 'trust' user input.
- [BUG] Encode binary strings as bytea in postgres, and fix a case where using a binary as key in an association would produce an error 1364. Thanks to @SohumB
- [FEATURE] sync() now correctly returns with an error when foreign key constraints reference unknown tables
- [BUG] sync() no longer fails with foreign key constraints references own table (toposort self-dependency error)
- [FEATURE] makes it possible to specify exactly what timestamp attributes you want to utilize #1334
- [FEATURE] Support coffee script files in migrations. #1357
- [FEATURE] include.where now supports Sequelize.and()/.or(). #1361
- [BUG] fixes issue with postgres sync and enums #1020
- [BUG] fixes various issues with limit and includes #1322
- [BUG] fixes issues with migrations/queryInterface createTable and enums
- [BUG] migration/queryInterface.addIndex() no longer fails on reserved keywords like 'from'
- [FEATURE] bulkCreate now supports a
ignoreDuplicates
option for MySQL, SQLite and MariaDB that will useINSERT IGNORE
- [BUG] fixes regression bug with 1:M self associations
- [FEATURE] significant performance improvements for 1:1 and single primary key includes for 500+ rows #1333
- find/findAll will now always return primary keys regardless of
attributes
settings. (Motivation was to fix various issues with eager loading)
- [FEATURE] dropAllTables now takes an option parameter with
skip
as an option #1280 - [FEATURE] implements .spread for eventemitters #1277
- [BUG] fixes some of the mysql connection error bugs #1282
- [Feature] Support for OR queries.
- [Feature] Support for HAVING queries. #1286
- [FEATURE] bulkUpdate and bulkDestroy now returns affected rows. #1293
- [BUG] fixes transaction memory leak issue
- [BUG] fixes security issue where it was possible to overwrite the id attribute when defined by sequelize (screwup - and fix - by mickhansen)
- [BUG] fixes unixSocket connections for mariadb #1248
- [BUG] fixes a hangup issue for mysql #1244
- [BUG] improves handling of uncaught errors in eventemitter #1245
- [BUG] fixes bug with mysql replication and pool settings #1251
- [BUG] fixes bug where through models created by N:M associations would inherit hooks #1263
- [FEATURE] .col()/.literal()/etc now works with findAll #1249
- [BUG] now currectly handles connection timeouts as errors #1207
- [FEATURE] async validations. #580. thanks to Interlock
- [FEATURE] instance.createAssociationInstance functionality added #1213
- [BUG] fixes a few bugs with transactions in regards to associations
- [FEATURE] add error handling for transaction creation
- [FEATURE]
sequelize --undo
will now actually undo migrations. Its basically an alias forsequelize --migrate --undo
. #1059 - [BUG] fix bug where
{where: {ne: null}}
would result in!= NULL
instead ofIS NOT NULL
#1231 - [BUG] fixes a bug with validation skipping using the
fields
options. #1233 - [BUG] fixes a bug with postgres and setters #1234
- [BUG] fixes it so
field: {type: Sequelize.ENUM(value1, value2)}
works
- Hooks are no longer passing value hashes. Instead, they are now passing instances of the model.
- Hook callbacks no longer take two arguments (previously:
err, newValues
). They only take the error argument since values can be changed directly on the model instance.
- [FEATURE] max()/min() now supports dates #1200
- [FEATURE] findAndCountAll now supports the include option
- You will now need to include the relevant subtables to query on them in finders (find/findAll)
- Subquery logic no longer depends on where objects with keys containing '.', instead where options on the include options #1199
- [FEATURE] Nested eager loading / prefetching is now supported. Docs
- [FEATURE] Eager loading / prefetching now supports inner joins and extending the ON statement #1199
- [FEATURE] Eager loading / prefetching now returns the attributes of through models aswell #1198
- [FEATURE] New set/get/changed/previous feature #1182
- Various bug fixes
None
- [DEPENDENCIES] Upgraded validator for IPv6 support. #603. thanks to durango
- [DEPENDENCIES] replaced underscore by lodash. #954. thanks to durango
- [DEPENDENCIES] Upgraded pg to 2.0.0. #711. thanks to durango
- [DEPENDENCIES] Upgraded command to 2.0.0 and generic-pool to 2.0.4. thanks to durango
- [DEPENDENCIES] No longer require semver. thanks to durango
- [BUG] Fix string escape with postgresql on raw SQL queries. #586. thanks to zanamixx
- [BUG] "order by" is now after "group by". #585. thanks to mekanics
- [BUG] Added decimal support for min/max. #583. thanks to durango
- [BUG] Null dates don't break SQLite anymore. #572. thanks to mweibel
- [BUG] Correctly handle booleans in MySQL. #608. Thanks to terraflubb
- [BUG] Fixed empty where conditions in MySQL. #619. Thanks to terraflubb
- [BUG] Allow overriding of default columns. #635. Thanks to sevastos
- [BUG] Fix where params for belongsTo #658. Thanks to mweibel
- [BUG] Default ports are now declared in the connector manager, which means the default port for PG correctly becomes 5432. #633. durango
- [BUG] Columns with type BOOLEAN were always added to toJSON output, even if they were not selected see. janmeier
- [BUG] Hstore is now fully supported #695. thanks to tadman
- [BUG] Correct join table name for tables with custom names #698. thanks to jjclark1982
- [BUG] PostgreSQL should now be able to insert empty arrays with typecasting. #718. thanks to durango
- [BUG] Fields should be escaped by quoteIdentifier for max/min functions which allows SQL reserved keywords to be used. #719. thanks to durango
- [BUG] Fixed bug when trying to save objects with eagerly loaded attributes #716. thanks to iamjochen
- [BUG] Strings for .find() should be fixed. Also added support for string primary keys to be found easily. #737. thanks to durango
- [BUG] bulkCreate would have problems with a disparate field list #738. thanks to durango
- [BUG] Fixed problems with quoteIdentifiers and {raw: false} option on raw queries #751. thanks to janmeier
- [BUG] Fixed SQL escaping with sqlite and unified escaping #700. thanks to PiPeep
- [BUG] Fixed Postgres' pools ff57af63
- [BUG] Fixed BLOB/TEXT columns having a default value declared in MySQL #793. thanks to durango
- [BUG] You can now use .find() on any single integer primary key when throwing just a number as an argument #796. thanks to durango
- [BUG] Adding unique to a column for Postgres in the migrator should be fixed #795. thanks to durango
- [BUG] For MySQL users, if their collation allows case insensitivity then allow enums to be case insensitive as well #794. thanks to durango
- [BUG] Custom primary key (not keys, just singular) should no longer be a problem for models when using any of the data retrievals with just a number or through associations #771. thanks to sdephold & durango
- [BUG] Default schemas should now be utilized when describing tables #812. thanks to durango
- [BUG] Fixed eager loading for many-to-many associations. #834. thanks to lemon-tree
- [BUG] allowNull: true enums can now be null #857. thanks to durango
- [BUG] Fixes Postgres' ability to search within arrays. #879. thanks to durango
- [BUG] Find and finAll would modify the options objects, now the objects are cloned at the start of the method #884 thanks to janmeier. Improved in #899 thanks to hackwaly
- [BUG] Add support for typed arrays in SqlString.escape and SqlString.arrayToList #891. thanks to LJ1102
- [BUG] Postgres requires empty array to be explicitly cast on update #890. thanks to robraux
- [BUG] Added tests & bugfixes for DAO-Factory.update and array of values in where clause #880. thanks to domasx2
- [BUG] sqlite no longer leaks a global
db
variable #900. thanks to xming - [BUG] Fix for counts queries with no result #906. thanks to iamjochem
- [BUG] Allow include when the same table is referenced multiple times using hasMany #913. thanks to janmeier
- [BUG] Allow definition of defaultValue for the timestamp columns (createdAt, updatedAt, deletedAt) #930. Thank to durango
- [BUG] Don't delete foreign keys of many-to-many associations, if still needed. #961. thanks to sdepold
- [BUG] Update timestamps when incrementing and decrementing #1023. durango
- [FEATURE] Validate a model before it gets saved. #601. thanks to durango
- [FEATURE] Schematics. #564. thanks to durango
- [FEATURE] Foreign key constraints. #595. thanks to optilude
- [FEATURE] Support for bulk insert (
<DAOFactory>.bulkCreate()
, update (<DAOFactory>.update()
) and delete (<DAOFactory>.destroy()
) #569. thanks to optilude - [FEATURE] Add an extra
queryOptions
parameter toDAOFactory.find
andDAOFactory.findAll
. This allows a user to specify{ raw: true }
, meaning that the raw result should be returned, instead of built DAOs. Usefull for queries returning large datasets, see #611 janmeier - [FEATURE] Added convenient data types. #616. Thanks to Costent
- [FEATURE] Binary is more verbose now. #612. Thanks to terraflubb
- [FEATURE] Promises/A support. #626. Thanks to kevinbeaty
- [FEATURE] Added Getters/Setters method for DAO. #538. Thanks to iamjochem
- [FEATURE] Added model wide validations. #640. Thanks to tremby
- [FEATURE]
findOrCreate
now returns an additional flag (created
), that is true if a model was created, and false if it was found #648. janmeier - [FEATURE] Field and table comments for MySQL and PG. #523. MySQL by iamjochen. PG by janmeier
- [FEATURE] BigInts can now be used for autoincrement/serial columns. #673. thanks to sevastos
- [FEATURE] Use moment for better postgres timestamp strings. #710. Thanks to seth-admittedly
- [FEATURE] Keep milliseconds in timestamps for postgres. #712. Thanks to seth-admittedly
- [FEATURE] You can now set lingo's language through Sequelize. #713. Thanks to durango
- [FEATURE] Added a
findAndCountAll
, useful for pagination. #533. Thanks to iamjochen - [FEATURE] Made explicit migrations possible. #728. Thanks to freezy
- [FEATURE] Added support for where clauses containing !=, < etc. and support for date ranges #727. Thanks to durango
- [FEATURE] Added support for model instances being referenced #761 thanks to sdepold
- [FEATURE] Added support for specifying the path to load a module for a dialect. #766 thanks to sonnym.
- [FEATURE] Drop index if exists has been added to sqlite #766 thanks to coderbuzz
- [FEATURE] bulkCreate() now has a third argument which gives you the ability to validate each row before attempting to bulkInsert #797. thanks to durango
- [FEATURE] Added
isDirty
to model instances. #798. Thanks to mstorgaard - [FEATURE] Added possibility to use env variable for the database connection. #784. Thanks to sykopomp.
- [FEATURE] Blob support. janmeier
- [FEATURE] We can now define our own custom timestamp columns #856. thanks to durango
- [FEATURE] Scopes. #748. durango
- [FEATURE] Model#find() / Model#findAll() is now working with strings. #855. Thanks to whito.
- [FEATURE] Shortcut method for getting a defined model. #868. Thanks to jwilm.
- [FEATURE] Added Sequelize.fn() and Sequelize.col() to properly call columns and functions within Sequelize. #882. thanks to janmeier
- [FEATURE] Sequelize.import supports relative paths. #901. thanks to accerqueira.
- [FEATURE] Sequelize.import can now handle functions. #911. Thanks to davidrivera.
- [FEATURE] Uses sequelize.fn and sequelize.col functionality to allow you to use the value of another column or a function when updating. It also allows you to use a function as a default value when supported (in sqlite and postgres). #928. thanks to janmeier
- [FEATURE] Added possibility to pass options to node-mysql. #929. thanks to poying
- [FEATURE] Triggers for Postgres. #915. Thanks to jonathana.
- [FEATURE] Support for join tables. #877. Thanks to janmeier.
- [FEATURE] Support for hooks. #894. Thanks to durango.
- [FEATURE] Support for literals and casts. #950. Thanks to durango.
- [FEATURE] Model#findOrBuild. #960. Thanks to durango.
- [FEATURE] Support for MariaDB. #948. Thanks to reedog117 and janmeier.
- [FEATURE] Filter through associations. #991. Thanks to snit-ram.
- [FEATURE] Possibility to disable loging for .sync #937. Thanks to durango
- [FEATURE] Support for transactions. 1062.
- [REFACTORING] hasMany now uses a single SQL statement when creating and destroying associations, instead of removing each association seperately 690. Inspired by #104. janmeier
- [REFACTORING] Consistent handling of offset across dialects. Offset is now always applied, and limit is set to max table size of not limit is given #725. janmeier
- [REFACTORING] Moved Jasmine to Buster and then Buster to Mocha + Chai. sdepold and durango
- [DEPENDENCIES] upgrade mysql to alpha7. You MUST use this version or newer for DATETIMEs to work
- [DEPENDENCIES] upgraded most dependencies. most important: mysql was upgraded to 2.0.0-alpha-3
- [DEPENDENCIES] mysql is now an optional dependency. #355 (thanks to clkao)
- [REFACTORING] separated tests for dialects
- [REFACTORING] reduced number of sql queries used for adding an element to a N:M association. #449 (thanks to innofluence/janmeier)
- [REFACTORING] dropped support for synchronous migrations. added third parameter which needs to get called once the migration has been finished. also this adds support for asynchronous actions in migrations.
- [OTHERS] code was formatted to fit the latest code style guidelines (thanks to durango)
- [OTHERS] Explicitly target ./docs folder for generate-docs script. #444 (thanks to carsondarling)
- [OTHERS] Overwrite existing daoFactoryDefinition if there already has been one. (thanks to robraux)
- [BUG] fixed wrong version in sequelize binary
- [BUG] local options have higher priority than global options (thanks to guersam)
- [BUG] fixed where clause when passing an empty array (thanks to kbackowski)
- [BUG] fixed updateAttributes for models/tables without primary key (thanks to durango)
- [BUG] fixed the location of the foreign key when using belongsTo (thanks to ricardograca)
- [BUG] don't return timestamps if only specific attributes have been seleceted (thanks to ricardograca)
- [BUG] fixed removeColumn for sqlite
- [BUG] fixed date equality check for instances. (thanks to solotimes)
- [FEATURE] added association prefetching /eager loading for find and findAll. #465
- [FEATURE] it's now possible to use callbacks of async functions inside migrations (thanks to mphilpot)
- [FEATURE] improved comfort of sequelize.query. just pass an sql string to it and wait for the result
- [FEATURE] Migrations now understand NODE_ENV (thanks to gavri)
- [FEATURE] Performance improvements (thanks to Mick-Hansen and janmeier from innofluence)
- [FEATURE] Model.find and Model.findAll can now take a String with an ID. (thanks to ghernandez345)
- [FEATURE] Compatibility for JSON-like strings in Postgres (thanks to aslakhellesoy)
- [FEATURE] honor maxConcurrentQueries option (thanks to dchester)
- [FEATURE] added support for stored procedures (inspired by wuyuntao)
- [FEATURE] added possibility to use pg lib's native api (thanks to denysonique)
- [FEATURE] added possibility to define the attributes of received associations (thanks to joshm)
- [FEATURE] added findOrCreate, which returns a the already existing instance or creates one (thanks to eveiga)
- [FEATURE] minConnections option for MySQL pooling (thanks to dominiklessel)
- [FEATURE] added BIGINT data type which is treated like a string (thanks to adamsch1)
- [FEATURE] experimental support for read replication for mysql (thanks to Janzeh)
- [FEATURE] allow definition of a models table name (thanks to slamkajs)
- [FEATURE] allow usage of enums. #440 (thanks to KevinMartin)
- [FEATURE] allows updateAttributes to target specific fields only (thanks to Pasvaz)
- [FEATURE] timestamps are now stored as UTC. #461 (thanks to innofluence/janmeier)
- [FEATURE] results of raw queries are parsed with dottie. #468 (thanks to kozze89)
- [FEATURE] support for array serialization. pg only. #443 (thanks to clkao)
- [FEATURE] add increment and decrement methods on dao. #408 (thanks to janmeier/innofluence)
- [FEATURE] unified the result of describeTable
- [FEATURE] add support for decimals (thanks to alexyoung)
- [FEATURE] added DAO.reload(), which updates the attributes of the DAO in-place (as opposed to doing having to do a find() and returning a new model)
- [REFACTORING] use underscore functions for Utils.isHash (thanks to Mick-Hansen/innofluence)
- [REFACTORING] removed the 'failure' event and replaced it with 'error'
- [BUG] fixed booleans for sqlite (thanks to vlmonk)
- [BUG] obsolete reference attribute for many-to-many associations are removed correctly
- [BUG] associations can be cleared via passing null to the set method
- [BUG] "fixed" quota handling (thanks to dgf)
- [BUG] fixed destroy in postgresql (thanks to robraux)
- [FEATURE] added possibility to set protocol and to remove port from postgresql connection uri (thanks to danielschwartz)
- [FEATURE] added possibility to not use a junction table for many-to-many associations on the same table (thanks to janmeier/innofluence)
- [FEATURE] results of the
import
method is now cached (thanks to janmeier/innofluence) - [FEATURE] added possibility to check if a specific object or a whole bunch of objects is currently associated with another object (thanks to janmeier/innofluence)
- [FEATURE] added possibility to globally disable adding of NULL values to sql queries (thanks to janmeier/innofluence)
- [FEATURE] Model.create can now also be used to specify values for mass assignment (thanks to janmeier/innofluence)
- [FEATURE] QueryChainer will now provide the results of the added emitters in the order the emitters have been added (thanks to LaurentZuijdwijk and me ;))
- [FEATURE] QueryChainer can now be initialized with serial items
- [FEATURE] node 0.8 compatibility
- [FEATURE] added options to hasMany getters (thanks to janmeier/innofluence)
- [FEATURE] pooling option is now correctly passed to postgres (thanks to megshark)
- [DEPRECATION] Added deprecation warning for node < v0.6.
- [FEATURE] added selective saving of instances (thanks to kioopi)
- [FEATURE] added command to binary for creating a migration skeleton with current timestamp
- [FEATURE] added
complete
function for each finder method (thanks to sstoiana) - [BUG] fixed quotation for sqlite statements (thanks to vlmonk)
- [BUG] fixed timestamp parsing in migratios (thanks to grn)
- [FEATURE] added consistent logging behaviour to postgres (thanks to reacuna)
- [BUG] fixed booleans in sqlite (thanks to alexstrat)
- [BUG] fixed forced sync of many-to-many associations (thanks to SirUli)
- [FEATURE] objects are now compatible to JSON.stringify. (thanks to grayt0r)
- [FEATURE] When instantiating the sequelize object, you can now pass a function to logging. This allows you to customize the logging behavior. Default is now: console.log (thanks to kenperkins)
- [BUG] The default logging is still console.log but is wrapped after initialization as it crashes node < 0.6.x.
- [FEATURE] postgresql support. (thanks to swoodtke)
- [FEATURE] connection-pooling for mysql. (thanks to megshark)
- [FEATURE] added possibility to define NOW as default value for date data-types. Use Sequelize.NOW as defaultValue
- [BUG] Fixed date handling in sqlite (thanks to iizukanao)
- [BUG] fixed issue where multiple belongsTo or hasOne associations to the same table overwrite each other
- [BUG] fixed memory leaks (thanks to megshark)
- [BUG] don't update an existing updatedAt-attribute if timestamps option for a DAO is false
- [BUG] fixed missed DAO renaming in migrations (thanks to nov)
- [REFACTORING] renamed Model/ModelFactory/ModelFactoryManager to DAO/DAOFactory/DAOFactoryManager
- [IMPROVEMENT]
npm test
will run the test suite (thanks to gabrielfalcao) - [IMPROVEMENT] documentation about setting up local development environment (thanks to gabrielfalcao)
- [REFACTORING] removed updatedAt + createdAt from SequelizeMeta
- [BUG] fixed sql-event emitter in all possible locations (thanks to megshark)
- [FEATURE] sqlite is now emitting the 'sql'-event as well (thanks to megshark)
- [REFACTORING] renamed ModelManager to ModelFactoryManager
- [IMPROVEMENT] decreased delay of CustomEventEmitter execution from 5ms to 1ms
- [IMPROVEMENT] improved performance of association handling (many-to-many) (thanks to magshark)
- [FEATURE] added possibility to specify name of the join table (thanks to magshark)
- [FEATURE] mysql is emitting a 'sql'-event when executing a query
- [BUG] correctly delete existing SequelizeMeta entry from database after undoing migration
- [BUG] fix path of migration files in executable (thanks to bcg)
- [REFACTORING] Model#all is now a function and not a getter.
- [REFACTORING] Renamed ModelDefinition to ModelFactory
- [REFACTORING] Private method scoping; Attributes are still public
- [REFACTORING] Use the new util module for node 0.6.2
- [FEATURE] QueryChainer can now run serially
- [FEATURE] Association definition is chainable: Person.hasOne(House).hasMany(Address)
- [FEATURE] Validations (Thanks to hiddentao)
- [FEATURE] jQuery-like event listeners: .success(callback) and .error(callback)
- [FEATURE] aliasing for select queries: Model.find({ where: 'id = 1', attributes: ['id', ['name', 'username']] }) ==> will return the user's name as username
- [FEATURE] cross-database support. currently supported: mysql, sqlite
- [FEATURE] migrations
- [TEST] removed all expresso tests and converted them to jasmine
- [REFACTORING] renamed the global options for sync, query and define on sequelize; before: options.queryOptions; now: options.query
- [FEATURE] allow definition of charset via global define option in sequelize or via charset option in sequelize.define
- [FEATURE] allow definition of mysql engine via global define option in sequelize or via engine option in sequelize.define; default is InnoDB now
- [FEATURE] find and findAll will now search in a list of values via: Model.findAll({where: { id: [1,2,3] }}); will return all models with id 1, 2 and 3
- [TEST] force latin1 charset for travis
- [FEATURE] min/max function for models, which return the min/max value in a column
- [FEATURE] getModel for modelManager for getting a model without storing it in a variable; use it via sequelize.modelManager.getModel('User')
- [TEST] test suite refactoring for jasmine
- [BUG] tables with identical prefix (e.g. wp_) can now be used in many-to-many associations
- [BUG] scoped options in model => a model can now have the attribute options
- [FEATURE] added drop method for sequelize, that drops all currently registered tables
- [BUG] prevent malfunction after being idle
- [BUG] fixed memory leaks
- [FEATURE] added query queueing (adjustable via maxConcurrentQueries in config; default: 50)
- [BUG] defaultValue 0 is now working
- [REMOVED] mysql-pool usage (will give it a new try later)
- [CHORE] updated node-mysql to 0.9.4
- [BUG] Fixed where clause generation for models with explicit primary keys (allanca)
- [BUG] Set insertId for non-default auto increment fields (allanca)
- [FEATURE] Added Model.count(callback), which returns the number of elements saved in the database
- [BUG] Fixed self associations
- complete rewrite
- added new emitter syntax
- sql injection protection
- select now supports hash usage of where
- select now supports array usage of where
- added a lot of options to find/findAll
- Wrapped queries correctly using
foo
- using expresso 0.7.2
- moved config for test database into seperated config file
- Added method for adding and deleting single associations
- renamed loadAssociatedData to fetchAssociations
- renamed Model#associatedData to fetchedAssociations
- added fetchAssociations to finder methods
- store data found by finder method in the associatedData hash + grep them from there if reload is not forced
- added option to sequelize constructor for disabling the pluralization of tablenames: disableTableNameModification
- allow array as value for chainQueries => Sequelize.chainQueries([save: [a,b,c]], callback)
- remove the usage of an array => Sequelize.chainQueries({save: a}, {destroy: b}, callback)
- fixed bugs from 0.4.1
- added the model instance method loadAssociatedData which adds the hash Model#associatedData to an instance which contains all associated data
-
THIS UPDATE CHANGES TABLE STRUCTURES MASSIVELY!
-
MAKE SURE TO DROP YOUR CURRENT TABLES AND LET THEM CREATE AGAIN!
-
names of many-to-many-association-tables are chosen from passed association names
-
foreign keys are chosen from passed association name
-
added many-to-many association on the same model
-
added hasManyAndBelongsTo
-
added hasOneAndBelongsTo
-
nodejs-mysql-native 0.4.2
- added error handling when defining invalid database credentials
- Sequelize#sync, Sequelize#drop, model#sync, model#drop returns errors via callback
- code is now located under lib/sequelize to use it with nDistro
- added possibility to use non default mysql database (host/port)
- added error handling when defining invalid database port/host
- schema definitions can now contain default values and null allowance
- database credentials can now also contain an empty / no password
- added possibility to define class and instance methods for models
- added import method for loading model definition from a file
- refactored Sequelize to fit CommonJS module conventions
- added BOOLEAN type
- added FLOAT type
- fixed DATE type issue
- fixed npm package
- fixed bug when using cross associated tables (many to many associations)
- added latest mysql connection library
- fixed id handling on save
- fixed text handling (varchar > 255; text)
- using the inflection library for naming tables more convenient
- Sequelize.TEXT is now using MySQL datatype TEXT instead of varchar(4000)
- released project as npm package
- fixed date bug
- added methods for setting associations
- added method for chaining an arbitraty amount of queries
- first stable version
- implemented all basic functions
- associations are working