Skip to content

Handle undefined field on unique constraint error (#10016)#10018

Merged
sushantdhiman merged 2 commits intosequelize:masterfrom
jusguy:fix-sqlite-unique-function-index
Oct 11, 2018
Merged

Handle undefined field on unique constraint error (#10016)#10018
sushantdhiman merged 2 commits intosequelize:masterfrom
jusguy:fix-sqlite-unique-function-index

Conversation

@jusguy
Copy link
Contributor

@jusguy jusguy commented Oct 10, 2018

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Change to AbstractQuery.getUniqueConstraintErrorMessage() to handle falsey field. This fixes the TypeError in #10016.

Closes #10016

@codecov
Copy link

codecov bot commented Oct 10, 2018

Codecov Report

Merging #10018 into master will increase coverage by 7.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10018      +/-   ##
==========================================
+ Coverage   89.29%   96.39%   +7.09%     
==========================================
  Files          61       63       +2     
  Lines        9293     9391      +98     
==========================================
+ Hits         8298     9052     +754     
+ Misses        995      339     -656
Impacted Files Coverage Δ
lib/dialects/sqlite/index.js 100% <ø> (ø) ⬆️
lib/dialects/abstract/index.js 100% <ø> (ø) ⬆️
lib/dialects/postgres/index.js 100% <ø> (ø) ⬆️
lib/dialects/abstract/query.js 91.34% <100%> (ø) ⬆️
lib/dialects/mssql/connection-manager.js 88.6% <0%> (ø)
lib/dialects/mssql/index.js 100% <0%> (ø)
lib/model.js 96.66% <0%> (+0.06%) ⬆️
lib/sequelize.js 96.58% <0%> (+0.62%) ⬆️
lib/query-interface.js 91.11% <0%> (+0.98%) ⬆️
lib/dialects/abstract/query-generator.js 97.65% <0%> (+4.07%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ded9755...68c3a78. Read the comment docs.

@sushantdhiman sushantdhiman merged commit 9b87cb8 into sequelize:master Oct 11, 2018
@sushantdhiman
Copy link
Contributor

Thanks @justinkalland

@jusguy jusguy deleted the fix-sqlite-unique-function-index branch October 14, 2018 01:14
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.

TypeError with sqlite when violating a unique function based index

2 participants