Format adds `@unique` without space
See original GitHub issueThis schema is formatted to have @unique
but without a space between it and the previous attribute:
generator client {
provider = "prisma-client-js"
previewFeatures = "mongodb"
}
datasource db {
provider = "mongodb"
url = "m...ty"
}
model Foo {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String @unique
json Json
bar Bar
bars Bar[]
baz Baz @relation(fields: [bazId], references: [id])
bazId String @db.ObjectId
list String[]
jsonList Json[]
}
type Bar {
label String
number Int
}
model Baz {
id String @id @default(auto()) @map("_id") @db.ObjectId
foo Foo?
}
leads to
bazId String @db.ObjectId@unique
^^
Formatting again then fixes to
bazId String @unique @db.ObjectId
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Extract a unique distinct list and ignore blanks - Get Digital Help
This article demonstrates formulas that extract unique distinct values and ignore blank empty cells. Table of contents Extract a unique ...
Read more >Unique values ignore blanks - Excel formula - Exceljet
To extract a list of unique values from a set of data, ignoring blank cells, you can use the UNIQUE function together with...
Read more >Spreadsheets get unique names but ignore blank cells
So far I've got this formula that returns all of the unique names from column A but I don't know how to go...
Read more >Fix text-formatted numbers by applying a number format
The TRIM function removes spaces from text except for single spaces between words. The CLEAN function removes all nonprintable characters from text.
Read more >SELECT DISTINCT in extra space data from a single column ...
Add a column with the name like [NormalizedCityName] , then copy your values into it and: replace multiple spaces with one space; add...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found the root cause, it will be easy to add spacing between attributes, but ordering them correctly (so reformat is idempotent) will take more work. Let’s try to tackle first things first.
Ok my reproduction attemps were flawed (reason mentioned in previous message), I can confirm that at 7e91d3111425c8915dcdd8e37bca69ddcb2c883d. Formatting once produces the schema with the weirdly placed
@unique
, second reformatting produces the good schema from my second message.