Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tinyint): ignore params for TINYINT on postgres #9992

Merged
merged 2 commits into from Oct 5, 2018

Conversation

t-bonatti
Copy link
Contributor

@t-bonatti t-bonatti commented Oct 4, 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

Proposal to fix #9738.
Postgres don't have type TINYINT.
With this PR the mesage error is more clear when use TINYINT.UNSIGNED. It's same when use TINYINT

From:
ERROR: syntax error at or near "UNSIGNED"

To:
type "tinyint" does not exist

@sushantdhiman what do you think?

@codecov
Copy link

codecov bot commented Oct 4, 2018

Codecov Report

Merging #9992 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9992      +/-   ##
==========================================
+ Coverage   96.38%   96.39%   +<.01%     
==========================================
  Files          63       63              
  Lines        9389     9400      +11     
==========================================
+ Hits         9050     9061      +11     
  Misses        339      339
Impacted Files Coverage Δ
lib/dialects/postgres/data-types.js 97.96% <100%> (+0.06%) ⬆️

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 9508888...20c3efe. Read the comment docs.

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

Choose a reason for hiding this comment

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

SMALLINT, TINYINT, BIGINT, INTEGER, DOUBLE and REAL share lots of duplicate code, it will be better to refactor it somehow. But that is not required in this PR, please just fix small typo and I will merge this

if (!(this instanceof TINYINT)) return new TINYINT(length);
BaseTypes.TINYINT.apply(this, arguments);

// POSTGRES does not support any parameters for bigint
Copy link
Contributor

Choose a reason for hiding this comment

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

// POSTGRES does not support any parameters for tinyint

@t-bonatti
Copy link
Contributor Author

@sunshinewyin Done!

@sushantdhiman sushantdhiman merged commit 9f58b82 into sequelize:master Oct 5, 2018
@sushantdhiman
Copy link
Contributor

Thanks @t-bonatti

@t-bonatti t-bonatti deleted the feature-9738 branch October 11, 2018 12:16
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.

Postgres Migration: ERROR: syntax error at or near "UNSIGNED"
2 participants