Skip to content

Fixed generated SQL when using find with through.where and required true - #4667

Merged
mickhansen merged 1 commit into
sequelize:masterfrom
Americas:master
Oct 19, 2015
Merged

Fixed generated SQL when using find with through.where and required true#4667
mickhansen merged 1 commit into
sequelize:masterfrom
Americas:master

Conversation

@Americas

Copy link
Copy Markdown
Contributor

when the primary key attribute is different from the primary key field

Kind of relates to ##3940. Using the primaryKeyAttribute generates wrong SQL if the database field and the model attributes are named differently.

@Americas

Copy link
Copy Markdown
Contributor Author

Seems like my changes don't fix the problem on mssql databases.. I can probably get my hands on one to see what the problem is

@mickhansen

Copy link
Copy Markdown
Contributor

Invalid column name 'name'.
That's odd, but mssql is a strange beast.

Otherwise great work, if you feel like taming mssql we'd be happy, but otherwise i'm okay with just skipping this test for mssql untill we can get an expert on it.

…rue and the primary key attribute is different from the primary key field
@Americas

Copy link
Copy Markdown
Contributor Author

Found the problem, another primaryKeyAttribute on mssql's query-generator function 'addLimitAndOffset'

The failing check now doesn't have anything to do with the change.

mickhansen added a commit that referenced this pull request Oct 19, 2015
Fixed generated SQL when using find with through.where and required true
@mickhansen
mickhansen merged commit 7f5a251 into sequelize:master Oct 19, 2015
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.

2 participants