yarn add -D prisma-schema-import
And install your schema package (prisma-schema-*)
yarn prisma-schema-import generate <schemaName>
prisma-schema-import will generate your schema package on '../prisma-schema-schemaName' directory.
Move to schema package directory, and edit package.json.
The package.json file generated by default does not contain author, repository, license, and publishConfig fields.
Fill in all the fields and deploy the package to an npm repository or private repository via npm or yarn's publish command.
yarn add -D <prisma-schema-schemaName>
yarn prisma-schema-import load
Install your schema package and run prisma-schema-import load command.
prisma-schema-import will load your schema on schema package, and overwrite a /prisma/schema.prisma file.
prisma-schema-import will process schema merge on schema is loaded.
If you want import other schema on prisma schema, write like below.
model User {
...
}
@import('./post.schema')
model Comment {
...
}
model Post {
...
}
load Load prisma schema from prisma-schema-* package
generate [options] <name> Generate prisma-schema-* package from prisma schema
-s --schema <schemaPath> path for exist prisma schema (default: "")
-p --package <packagePath> path for generated package (default: "")