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

[legacy-framework] Fix generators not support string ids #2267

Conversation

MrLeebo
Copy link
Member

@MrLeebo MrLeebo commented Apr 24, 2021

Closes: blitz-js/legacy-framework#113

What are the changes and their implications?

  • Introduces @mrleebo/prisma-ast to the generator package
  • Replaces the generator schema file formatting code with printSchema
  • Skip rendering default model columns if the user specifies a column with the same name (if you defined your own "id" column you'd end up with 2 in the schema.prisma file)
  • Remove tests dealing with conversion of plural/singular names and reorganize tests around what the code is currently doing
  • Adds a test to cover the bug in Generators don't support string IDs legacy-framework#113
  • Mark columns called "id" as the ID column (adds the @id attribute to the column)

Bug Checklist

  • Integration test added (see test docs if needed)

  - Introduces @mrleebo/prisma-ast to the generator package
  - Replaces the generator schema file formatting code with printSchema
  - Skip rendering default model columns if the user specifies a column with the same name
  - Remove tests dealing with conversion of plural/singular names and reorganize tests around what the code is currently doing
  - Mark columns called "id" as the ID column
@flybayer
Copy link
Member

@MrLeebo you have a failing test

@MrLeebo
Copy link
Member Author

MrLeebo commented Apr 28, 2021

@flybayer fixed and all the checks are passing 👍

@flybayer flybayer changed the title Fixes #2215 by parsing the schema to retrieve the type of the relation's ID column Fix generators not support string ids Apr 28, 2021
@flybayer flybayer merged commit 4bb6ded into blitz-js:canary Apr 28, 2021
@itsdillon itsdillon changed the title Fix generators not support string ids [legacy-framework] Fix generators not support string ids Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generators don't support string IDs
3 participants