@@ -4,13 +4,14 @@ Notice: All 1.7.x changes are present in 2.0.x aswell
-[FEATURE] Hooks can now return promises
-[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 in `sequelize.models` Object e.g. `sequelize.models.MyModel`
-[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](https://github.com/sequelize/sequelize/issues/1272)
#### Breaking changes
- Sequelize now returns promises instead of its custom event emitter from most calls. This affects methods that return multiple values (like `findOrCreate` or `findOrInitialize`). 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 like `QueryInterface.on('showAllSchemas', function ... `
-`define()` stores models in `sequelize.models` Object e.g. `sequelize.models.MyModel`
# v2.0.0-dev11
### Caution: This release contains many changes and is highly experimental
thrownewError("Naming collision between attribute '"+this.as+"' and association '"+this.as+"' on model "+this.source.name+". To remedy this, change either foreignKey or as in your association definition")
thrownewError("Naming collision between attribute '"+this.as+"' and association '"+this.as+"' on model "+this.source.name+". To remedy this, change either foreignKey or as in your association definition")
thrownewError("Naming collision between attribute '"+this.as+"' and association '"+this.as+"' on model "+this.source.name+". To remedy this, change either foreignKey or as in your association definition")
.throw("Naming collision between attribute 'person' and association 'person' on model car. To remedy this, change either foreignKey or as in your association definition")
})
it('should throw an error if an association clashes with the name of an already define attribute',function(){
.throw("Naming collision between attribute 'person' and association 'person' on model car. To remedy this, change either foreignKey or as in your association definition")
.throw("Naming collision between attribute 'user' and association 'user' on model user. To remedy this, change either foreignKey or as in your association definition")
it('should throw an error if an association clashes with the name of an already define attribute',function(){
varUser=this.sequelize.define('user',{
attribute:Sequelize.STRING
})
,Attribute=this.sequelize.define('attribute',{})
expect(User.hasOne.bind(User,Attribute)).to
.throw("Naming collision between attribute 'attribute' and association 'attribute' on model user. To remedy this, change either foreignKey or as in your association definition")
@@ -36,35 +36,6 @@ describe(Support.getTestDialectTeaser("Include"), function () {
})
})
// We don't support naming associations the same as the foreign key, however the system should not crash because of it, the results hould just be wrong as is expected behaviour currently.
it('should not throw an error when an empty include is named the same as the foreign key',function(done){