Skip to content

bulkCreate would have problems with a disparate field list. Closes #736#738

Merged
sdepold merged 3 commits intosequelize:masterfrom
durango:bulkcreate
Jul 16, 2013
Merged

bulkCreate would have problems with a disparate field list. Closes #736#738
sdepold merged 3 commits intosequelize:masterfrom
durango:bulkcreate

Conversation

@durango
Copy link
Copy Markdown
Member

@durango durango commented Jun 29, 2013

I'm not sure if this affects performance much, probably a little bit especially with a lot of rows... but there are much bigger things to blame for performance issues than this PR. Sequelize needs a little bit of remodeling pretty soon ;)

@durango
Copy link
Copy Markdown
Member Author

durango commented Jun 29, 2013

I believe the tests in hasMany associations should be changed to (2,1) from (1,2)... please check travis logs to see what I'm talking about. This might be a false flag in the current test suite :)

@janmeier
Copy link
Copy Markdown
Member

I believe it was changed in a recent PR. Will try to figure it whats correct :D

@janmeier
Copy link
Copy Markdown
Member

I would say that

INSERT INTO `TasksUsers` (`TaskId`,`UserId`) VALUES (1,1),(2,1)

is correct. We create one user and assigns two tasks. The userid is the same, but taskid is different

Actually, to make this test completely valid we should also check the correct order of the columns (i.e. also assert that the order is TaskId, UserId and not the other way around). The problem then becomes that we have to take into account different qouting methods. Perhaps we could assert that indexof taskid < indexof userid?

@durango
Copy link
Copy Markdown
Member Author

durango commented Jul 1, 2013

@sdepold (or @mickhansen or anyone else for that matter) you mind voicing your opinion on this issue? Only reason why I'm pinging is because this PR would be changing a test case. Just want to make sure @janmeier and myself aren't crazy ;)

@durango
Copy link
Copy Markdown
Member Author

durango commented Jul 8, 2013

@janmeier updated :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow smart :)

@sdepold
Copy link
Copy Markdown
Member

sdepold commented Jul 16, 2013

looks good. also 2,1 seems to be the more correct version

sdepold added a commit that referenced this pull request Jul 16, 2013
bulkCreate would have problems with a disparate field list. Closes #736
@sdepold sdepold merged commit 93016a0 into sequelize:master Jul 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants