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

[DONOT MERGE]fix: handle Enums correctly on Typescript data schema generation #2965

Draft
wants to merge 105 commits into
base: main
Choose a base branch
from

Conversation

tejas2008
Copy link
Contributor

@tejas2008 tejas2008 commented Oct 17, 2024

Description of changes

  • Update Schema generator package to add handling of enums globally
  • Inside the model use ref() to define those enums
  • Added unit test to handle various combination of enum possibilities for Postgresql and mysql
CDK / CloudFormation Parameters Changed

Issue #, if available

#2596

Description of how you validated changes

  • Updated a current test snapshot
  • Added more unit tests to validate proper enum handling generating snapshots and passing tests.

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@tejas2008 tejas2008 requested review from a team as code owners October 17, 2024 20:21
amplify-data-ci and others added 24 commits October 29, 2024 16:01
* refactor: combine indexName assignment branches

* refactor: explicitly assign undefined in falsy condition for table validation

* docs: remove unnecessary comment
* test: add some migration validation tests

* test: override migration e2es to use ddb managed encryption

* chore: split e2e tests

* test: temp for testing

* Revert "test: temp for testing"

This reverts commit 84ff77b.
* chore: add missing types

* test: ts schema serial field gen happy case

* test: ts schema serial field gen sad cases

* chore: add DEFAULT_METHOD to TS schema constants

* feat: intepret pg serial fields in ts schema gen

* test: do not handle db provided int constants

* refactor: simpler serial field default condition

* test: pg string adapter sets model field correctly from a schema with a SERIAL field

* test: align text in template string

the text alignment was causing weird names in snaphot

* test: serial gen snapshots against all of getModels()

* refactor: extract sequence field identification logic

* chore: no-op change to force rebuild
…tion"

This reverts commit 2f303b4, reversing
changes made to 8da7802.
@tejas2008 tejas2008 changed the title fix: handle Enums correctly on Typescript data schema generation [DONOT MERGE]fix: handle Enums correctly on Typescript data schema generation Oct 30, 2024
@tejas2008 tejas2008 marked this pull request as draft October 30, 2024 00:44
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.

10 participants