question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`--migrations` to specify output directory for migrations

See original GitHub issue

With --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:open
  • Created 4 years ago
  • Reactions:15
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
zakthedevcommented, Sep 24, 2020

it would be better if the migrations output could be set via package.json as follows:

“prisma”: { “schema”: “src/schema.prisma”, “migrateOutput” : “src/migrations/” }

5reactions
Jolg42commented, May 5, 2021

@benhickson Thank you for the detailed explanation!

I guess a workaround could be something like this, one folder per schema:

  • ./src/db1/schema.prisma
  • ./src/db2/schema.prisma

And then calling prisma commands with --schema="./src/db1/schema.prisma"

Migrate will then create a migrations directory next to each schema like

  • ./src/db1/migrations/…
  • ./src/db2/migrations/…

Is that a good enough workaround or customizing the name of the migrations directory would be better here?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found