Skip to content

fix(mysql): boolean TINYINT support - #10644

Merged
sushantdhiman merged 1 commit into
sequelize:masterfrom
gabegorelick:tinyint-boolean
Mar 29, 2019
Merged

sushantdhiman merged 1 commit into
sequelize:masterfrom
gabegorelick:tinyint-boolean

Conversation

@gabegorelick

@gabegorelick gabegorelick commented Mar 28, 2019 •

Copy link
Copy Markdown
Contributor

This regressed in #10492

Fixes #10600
Fixes #10633

Pull Request check-list

  • 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

Bring back support for passing booleans into TINYINT fields.

@codecov

codecov Bot commented Mar 28, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #10644 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10644   +/-   ##
=======================================
  Coverage    96.2%    96.2%           
=======================================
  Files          93       93           
  Lines        9011     9011           
=======================================
  Hits         8669     8669           
  Misses        342      342
Impacted Files Coverage Δ
lib/data-types.js 91.25% <100%> (ø) ⬆️

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 a421c35...3e94ac2. Read the comment docs.

});
});

if (dialect === 'mysql') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we could make this a simple unit test, not mysql specific?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This behavior is specific to MySQL. On other platforms, where TRUE and FALSE are not aliases for 1 and 0 respectively, passing a boolean literal where a number is expected will result in an error.

@sushantdhiman
sushantdhiman merged commit 9757d24 into sequelize:master Mar 29, 2019
@sushantdhiman

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gabegorelick
gabegorelick deleted the tinyint-boolean branch March 30, 2019 02:22
gabegorelick added a commit to gabegorelick/sequelize that referenced this pull request Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants