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: support postgres column with varchar datatype and uuid_generate_v4() default #9065

Merged
merged 2 commits into from
Aug 24, 2022

Conversation

knarfchan
Copy link
Contributor

@knarfchan knarfchan commented Jun 2, 2022

Description of change

Fixes #9063.

If the column type of a Postgres column is not uuid, we should not treat it as a generated column, but rather just a column with a default. This will allow us to define columns that are type varchar with uuid_generate_v4() while producing the correct migration scripts.

I'm not quite sure how to write tests for this fix. Any pointers would be appreciated!

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • 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

@knarfchan knarfchan changed the title do not mark a column with generated uuid as isGenerated if the data type is not uuid fix: support postgres column with varchar datatype and uuid_generate_v4() default Jun 2, 2022
@pleerock pleerock requested a review from AlexMesser June 28, 2022 14:42
@AlexMesser AlexMesser merged commit dadb658 into typeorm:master Aug 24, 2022
@AlexMesser
Copy link
Collaborator

thank you for contribution!

wirekang pushed a commit to wirekang/typeorm that referenced this pull request Aug 25, 2022
…efault (typeorm#9065)

* fix: support postgres column with varchar datatype and uuid_generate_v4() default

Closes: typeorm#9063

* added test

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
nordinh pushed a commit to nordinh/typeorm that referenced this pull request Aug 29, 2022
…efault (typeorm#9065)

* fix: support postgres column with varchar datatype and uuid_generate_v4() default

Closes: typeorm#9063

* added test

Co-authored-by: Dmitry Zotov <dmzt08@gmail.com>
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.

Support postgres column with varchar datatype and uuid_generate_v4() default
2 participants