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: redundant migration with decimal default #6879

Merged
merged 2 commits into from
Oct 11, 2020

Conversation

jeiea
Copy link
Contributor

@jeiea jeiea commented Oct 9, 2020

MySQL/MariaDB decimal column is represented like '0.0'.
MysqlDriver.normalizeDefault didn't consider trailing zeros.
User can bypass this by passing default as string, but we
can't guide the zeros by type, so we should convert user input.

Close #6140
Close #5407

@jeiea jeiea changed the title fix: normalization of decimal default with mysql fix: redundant migration with decimal default Oct 10, 2020
@jeiea jeiea requested a review from imnotjames October 11, 2020 00:29
Copy link
Contributor

@imnotjames imnotjames left a comment

Choose a reason for hiding this comment

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

🎉 Lookin good! Two small questions then we're good to go I think

test/github-issues/5407/entity/EnumUser.ts Outdated Show resolved Hide resolved
test/github-issues/5407/entity/CommonUser.ts Outdated Show resolved Hide resolved
@imnotjames
Copy link
Contributor

imnotjames commented Oct 11, 2020

Failure was an issue with circleci - kicking the tests :) Should work after that!

src/driver/cockroachdb/CockroachDriver.ts Outdated Show resolved Hide resolved
src/driver/postgres/PostgresDriver.ts Outdated Show resolved Hide resolved
@jeiea jeiea force-pushed the fix-decimal-default branch 2 times, most recently from e7dd6f4 to 2b1f6b5 Compare October 11, 2020 08:43
@jeiea jeiea requested a review from imnotjames October 11, 2020 08:57
MySQL/MariaDB decimal column is represented like '0.0'.
MysqlDriver.normalizeDefault didn't consider trailing zeros.
User can bypass this by passing default as string, but we
can't guide the zeros by type, so we should convert user input.

undefined scale was compared with defined scale. Skip this comparison.

Close typeorm#6140
Close typeorm#5407
@imnotjames imnotjames merged commit 6ff67f7 into typeorm:master Oct 11, 2020
@imnotjames
Copy link
Contributor

Wonderful. Thanks for the contribution!

@imnotjames imnotjames added the hacktoberfest-accepted label hacktoberfest label Oct 11, 2020
zaro pushed a commit to zaro/typeorm that referenced this pull request Jan 12, 2021
MySQL/MariaDB decimal column is represented like '0.0'.
MysqlDriver.normalizeDefault didn't consider trailing zeros.
User can bypass this by passing default as string, but we
can't guide the zeros by type, so we should convert user input.

undefined scale was compared with defined scale. Skip this comparison.

Close typeorm#6140
Close typeorm#5407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted label hacktoberfest
Projects
None yet
2 participants