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: handle postgres default when tableColumn.default is not string #7816

Merged

Conversation

imnotjames
Copy link
Contributor

@imnotjames imnotjames commented Jun 29, 2021

Description of change

fixes #7810

there was an edge case where the tableColumn.default was not a string
and thus caused a TypeError to be emitted when we tried to substring
it. instead, we check the type first and only if that type is a
string do we try to decode it

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@imnotjames imnotjames force-pushed the fix/7810/postgres-jsonb-compat-with-sync branch 5 times, most recently from dbc6dea to cdb9781 Compare June 30, 2021 03:38
there was an edge case where the tableColumn.default was not a string
and thus caused a TypeError to be emitted when we tried to `substring`
it.  instead, we check the type first and only if that type is a
string do we try to decode it
@imnotjames imnotjames force-pushed the fix/7810/postgres-jsonb-compat-with-sync branch from cdb9781 to a35d457 Compare June 30, 2021 04:04
@imnotjames imnotjames merged commit 0463855 into typeorm:master Jun 30, 2021
@imnotjames imnotjames deleted the fix/7810/postgres-jsonb-compat-with-sync branch June 30, 2021 05:11
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.

v0.2.33 breaks Postgres jsonb compatibility with sync
1 participant