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

Commit bb6650d2 by Jan Aagaard Meier

Weird merge

2 parents 8d2bb59a a2b24001
...@@ -2,12 +2,9 @@ Notice: All 1.7.x changes are present in 2.0.x aswell ...@@ -2,12 +2,9 @@ Notice: All 1.7.x changes are present in 2.0.x aswell
# v2.0.0-dev11 # v2.0.0-dev11
- [PERFORMANCE] increased build performance when using include, which speeds up findAll etc. - [PERFORMANCE] increased build performance when using include, which speeds up findAll etc.
<<<<<<< HEAD
- [BUG] Made it possible to use HSTORE both in attribute: HSTORE and attribute: { type: HSTORE } form. Thanks to @tomchentw [#1458](https://github.com/sequelize/sequelize/pull/1458) - [BUG] Made it possible to use HSTORE both in attribute: HSTORE and attribute: { type: HSTORE } form. Thanks to @tomchentw [#1458](https://github.com/sequelize/sequelize/pull/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] 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 useConstrations: false to your assocation call (`M1.belongsTo(M2, { useConstraints: false})`). - [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 useConstrations: false to your assocation call (`M1.belongsTo(M2, { useConstraints: false})`).
>>>>>>> Removed synconassocation, added ondelete and onupdate to n:m and made cascade the default, made cascade / set null the default for hasone and belongsto
#### Backwards compatability changes #### Backwards compatability changes
- selectedValues has been removed for performance reasons, if you depend on this, please open an issue and we will help you work around it. - selectedValues has been removed for performance reasons, if you depend on this, please open an issue and we will help you work around it.
......
...@@ -211,8 +211,7 @@ describe(Support.getTestDialectTeaser("HasOne"), function() { ...@@ -211,8 +211,7 @@ describe(Support.getTestDialectTeaser("HasOne"), function() {
}) })
}) })
describe('foreign key', function () {
describe("Foreign key constraints", function() {
it('should lowercase foreign keys when using underscored', function () { it('should lowercase foreign keys when using underscored', function () {
var User = this.sequelize.define('User', { username: Sequelize.STRING }, { underscored: true }) var User = this.sequelize.define('User', { username: Sequelize.STRING }, { underscored: true })
, Account = this.sequelize.define('Account', { name: Sequelize.STRING }, { underscored: true }) , Account = this.sequelize.define('Account', { name: Sequelize.STRING }, { underscored: true })
...@@ -229,7 +228,9 @@ describe(Support.getTestDialectTeaser("HasOne"), function() { ...@@ -229,7 +228,9 @@ describe(Support.getTestDialectTeaser("HasOne"), function() {
expect(User.rawAttributes.AccountId).to.exist expect(User.rawAttributes.AccountId).to.exist
}) })
})
describe("foreign key constraints", function() {
it("are enabled by default", function(done) { it("are enabled by default", function(done) {
var Task = this.sequelize.define('Task', { title: Sequelize.STRING }) var Task = this.sequelize.define('Task', { title: Sequelize.STRING })
, User = this.sequelize.define('User', { username: Sequelize.STRING }) , User = this.sequelize.define('User', { username: Sequelize.STRING })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!