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.

Set migration-dir or scope / internals.migrationMode from config with -e option?

See original GitHub issue

Hi just trying to figure out how to use db-migrate in a simple way. I have a database.json in a config directory, postgresql so a connection string for a user that has ownership of a database schema I want to work with.

Is there a way to do something like this?

database.json

{
  "myConnection":
  {
    "connectionString": "etc...",
    "migrationMode": "myMode",
    "migrations-dir":  "./migrations/myConnection"
  }
}

So that when I do

db-migrate create something

It would create in

./migrations/myConnection/myMode/date-something.js

Or even just a migration directory setting per connection config would be nice.

./migrations/myConnection/date-something.js

I feel writing so much is not ideal would be nice to just write simple command to up or create new migration.

db-migrate create something --config=./config/database.json -v -e myConnection

Easier like this?

db-migrate create something -e myConnection
db-migrate up -e myConnection

Having it in database connection configs would allow to have multiple connections use the same migration scripts but have different databases/schemas.

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wzrdtalescommented, Nov 22, 2017

that is a way too, or MAKESCRIPTS, but still a good suggestion worth having a thought for.

0reactions
LiamKarlMitchellcommented, Nov 23, 2017

Good to know thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set migration-dir or scope / internals.migrationMode from config with ...
Hi just trying to figure out how to use db-migrate in a simple way. I have a database.json in a config directory, postgresql...
Read more >
0.3.0 generate migrations path · Issue #8762 - GitHub
Issue Description Expected Behavior When running migration:generate, I expect the migration generated goes into the migrations path set in ...
Read more >
Setting up typeorm with nestjs not working migrations
First, you need to set the migrations path in the module config TypeOrmModule.forRootAsync({ // other properties entities: [ __dirname + '/.
Read more >
16 How to run or setup migrations in Nest JS with TypeORM
nodejs #nestjs #javascriptIn this video, we are going to look at how we can set up our Nest JS application to start using...
Read more >
Migrations - typeorm - GitBook
In addition to these flags, you can also override the transaction behavior on a per-migration basis by setting the transaction property on the ......
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