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
不要怂,就是干,撸起袖子干!
You need to sign in or sign up before continuing.
Commit 86d0bf9f
authored
Feb 04, 2014
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle models with a column named length in bulkcreate
1 parent
cec519bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
lib/dialects/mysql/query-generator.js
lib/dialects/postgres/query-generator.js
lib/dialects/sqlite/query-generator.js
test/dao-factory/create.test.js
lib/dialects/mysql/query-generator.js
View file @
86d0bf9
...
...
@@ -182,7 +182,7 @@ module.exports = (function() {
,
allAttributes
=
[]
Utils
.
_
.
forEach
(
attrValueHashes
,
function
(
attrValueHash
,
i
)
{
Utils
.
_
.
for
Each
(
attrValueHash
,
function
(
value
,
key
,
hash
)
{
Utils
.
_
.
for
Own
(
attrValueHash
,
function
(
value
,
key
,
hash
)
{
if
(
allAttributes
.
indexOf
(
key
)
===
-
1
)
allAttributes
.
push
(
key
)
})
})
...
...
lib/dialects/postgres/query-generator.js
View file @
86d0bf9
...
...
@@ -274,7 +274,7 @@ module.exports = (function() {
,
allAttributes
=
[]
Utils
.
_
.
forEach
(
attrValueHashes
,
function
(
attrValueHash
,
i
)
{
Utils
.
_
.
for
Each
(
attrValueHash
,
function
(
value
,
key
,
hash
)
{
Utils
.
_
.
for
In
(
attrValueHash
,
function
(
value
,
key
,
hash
)
{
if
(
allAttributes
.
indexOf
(
key
)
===
-
1
)
allAttributes
.
push
(
key
)
if
(
tables
[
tableName
]
&&
tables
[
tableName
][
key
])
{
...
...
lib/dialects/sqlite/query-generator.js
View file @
86d0bf9
...
...
@@ -178,7 +178,7 @@ module.exports = (function() {
,
allAttributes
=
[]
Utils
.
_
.
forEach
(
attrValueHashes
,
function
(
attrValueHash
,
i
)
{
Utils
.
_
.
for
Each
(
attrValueHash
,
function
(
value
,
key
,
hash
)
{
Utils
.
_
.
for
Own
(
attrValueHash
,
function
(
value
,
key
,
hash
)
{
if
(
allAttributes
.
indexOf
(
key
)
===
-
1
)
allAttributes
.
push
(
key
)
})
})
...
...
test/dao-factory/create.test.js
View file @
86d0bf9
...
...
@@ -911,6 +911,18 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
it
(
'properly handles a model with a length column'
,
function
(
done
)
{
var
UserWithLength
=
this
.
sequelize
.
define
(
'UserWithLength'
,
{
length
:
Sequelize
.
INTEGER
})
UserWithLength
.
sync
({
force
:
true
}).
success
(
function
()
{
UserWithLength
.
bulkCreate
([{
length
:
42
},
{
length
:
11
}]).
success
(
function
()
{
done
()
})
})
})
it
(
'stores the current date in createdAt'
,
function
(
done
)
{
var
self
=
this
,
data
=
[{
username
:
'Peter'
},
...
...
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