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

reformatting: Fix spacing between attributes in edge cases #2833

Merged
merged 3 commits into from
Apr 8, 2022

Conversation

tomhoule
Copy link
Contributor

@tomhoule tomhoule commented Apr 8, 2022

In 1:1 relations, the reformatter can add @unique attributes. If they
come after a native type attribute, the reformatter failed to add
adequate spacing between the attributes, resulting in valid but odd
looking schemas. This commit fixes that problem.

These schemas are also not idempotent, because of interactions between
attribute sorting and missing attributes addition. Issue:
prisma/prisma#12726

closes prisma/prisma#12596

@tomhoule tomhoule added this to the 3.13.0 milestone Apr 8, 2022
In 1:1 relations, the reformatter can add `@unique` attributes. If they
come after a native type attribute, the reformatter failed to add
adequate spacing between the attributes, resulting in valid but odd
looking schemas. This commit fixes that problem.

These schemas are also not idempotent, because of interactions between
attribute sorting and missing attributes addition. Issue:
prisma/prisma#12726

closes prisma/prisma#12596
@tomhoule tomhoule force-pushed the format/weird-at-unique branch 2 times, most recently from 28d077d to aa58c9a Compare April 8, 2022 10:13
Popped up with rust 1.60 yesterday.
@tomhoule tomhoule marked this pull request as ready for review April 8, 2022 10:25
@tomhoule tomhoule requested a review from a team as a code owner April 8, 2022 10:25
@tomhoule tomhoule merged commit 8940c97 into main Apr 8, 2022
@tomhoule tomhoule deleted the format/weird-at-unique branch April 8, 2022 10:58
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.

Format adds @unique without space
2 participants