Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 9577de6d
authored
Feb 02, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into milestones/2.0.0
2 parents
cfbb81fe
e528ac6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
changelog.md
lib/dao-factory-manager.js
test/sequelize.test.js
changelog.md
View file @
9577de6
Notice: All 1.7.x changes are present in 2.0.x aswell
Notice: All 1.7.x changes are present in 2.0.x aswell
# v1.7.0-rc5
-
sync() now correctly returns with an error when foreign key constraints reference unknown tables
-
sync() no longer fails with foreign key constraints references own table (toposort self-dependency error)
# v1.7.0-rc4
# v1.7.0-rc4
-
fixes issue with postgres sync and enums
[
#1020
](
https://github.com/sequelize/sequelize/issues/1020
)
-
fixes issue with postgres sync and enums
[
#1020
](
https://github.com/sequelize/sequelize/issues/1020
)
-
fixes various issues with limit and includes
[
#1322
](
https://github.com/sequelize/sequelize/pull/1322
)
-
fixes various issues with limit and includes
[
#1322
](
https://github.com/sequelize/sequelize/pull/1322
)
...
...
lib/dao-factory-manager.js
View file @
9577de6
...
@@ -56,6 +56,9 @@ module.exports = (function() {
...
@@ -56,6 +56,9 @@ module.exports = (function() {
}
}
}
}
deps
=
deps
.
filter
(
function
(
dep
)
{
return
dao
.
tableName
!==
dep
})
sorter
.
add
(
dao
.
tableName
,
deps
)
sorter
.
add
(
dao
.
tableName
,
deps
)
})
})
...
...
test/sequelize.test.js
View file @
9577de6
...
@@ -488,6 +488,34 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
...
@@ -488,6 +488,34 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
done
()
done
()
})
})
})
})
it
(
'handles self dependant foreign key constraints'
,
function
(
done
)
{
var
block
=
this
.
sequelize
.
define
(
"block"
,
{
id
:
{
type
:
DataTypes
.
INTEGER
,
primaryKey
:
true
},
name
:
DataTypes
.
STRING
},
{
tableName
:
"block"
,
timestamps
:
false
,
paranoid
:
false
});
block
.
hasMany
(
block
,
{
as
:
'childBlocks'
,
foreignKey
:
'parent'
,
joinTableName
:
'link_block_block'
,
useJunctionTable
:
true
,
foreignKeyConstraint
:
true
});
block
.
belongsTo
(
block
,
{
as
:
'parentBlocks'
,
foreignKey
:
'child'
,
joinTableName
:
'link_block_block'
,
useJunctionTable
:
true
,
foreignKeyConstraint
:
true
});
this
.
sequelize
.
sync
().
done
(
done
)
})
}
}
describe
(
"doesn't emit logging when explicitly saying not to"
,
function
()
{
describe
(
"doesn't emit logging when explicitly saying not to"
,
function
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment