Omar
11/05/2021, 4:46 PMPrisma Schema Sorter
using the CLI, as simple as:
npx prisma-schema-sorter sort --schema=path
The schema
option can be omitted, if it's on the default path:
npx prisma-schema-sorter sort
Additionally, I personally added it to package.json
for quicker access and to integrate it with other scripts:
{
"scripts": {
"sort-schema": "npx prisma-schema-sorter sort --schema='./prisma/schema.prisma'"
}
}
In the future we could make it better by specifying other types of sorting besides the current default ascending
. You can always send your thoughts, suggestions and contributions there.
The latest version is here: https://www.npmjs.com/package/prisma-schema-sorter