`--migrations` to specify output directory for migrations
See original GitHub issueWith --schema we can now specify the file path of where the Prisma Schema is located, instead of the default ./prisma/schema.prisma. This has the unfortunate side effect, that migrations are also output next to that file - which might not be what you want.
We want to have a --migrations parameter that takes the path to a folder where all the migration related content is output. The default path for that parameter, if it is not supplied, thus is ./prisma/migrations.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:13 (4 by maintainers)
Top Results From Across the Web
How to change the output folder for migrations with asp.net ...
The directory used to output the files. Paths are relative to the target project directory. Defaults to "Migrations". --namespace <NAMESPACE>, - ...
Read more >migrations to specify output directory for migrations #4720
We want to have a --migrations parameter that takes the path to a folder where all the migration related content is output. The...
Read more >Managing Migrations - EF Core - Microsoft Learn
New migrations are created as siblings of the last migration. Alternatively, you can specify the directory at generation time as follows:
Read more >Changing Entity Framework Core Migrations Folder
By default, Entity Framework Core migrations will put your migration code inside of a Migrations folder in the root of your project.
Read more >EF Code-Fist Migrations: How to set the Migrations folder
EF Code-Fist Migrations: How to set the Migrations folder ... Here, AddColumnFistName it's the Migration name, and is just an example of a ......
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 Free
Top 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

it would be better if the migrations output could be set via package.json as follows:
“prisma”: { “schema”: “src/schema.prisma”, “migrateOutput” : “src/migrations/” }
@benhickson Thank you for the detailed explanation!
I guess a workaround could be something like this, one folder per schema:
And then calling prisma commands with
--schema="./src/db1/schema.prisma"Migrate will then create a migrations directory next to each schema like
Is that a good enough workaround or customizing the name of the migrations directory would be better here?