Skip to content

Specify migrations directory over progamable API #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 3 tasks
BorntraegerMarc opened this issue Mar 20, 2018 · 4 comments
Closed
1 of 3 tasks

Specify migrations directory over progamable API #553

BorntraegerMarc opened this issue Mar 20, 2018 · 4 comments

Comments

@BorntraegerMarc
Copy link
Contributor

BorntraegerMarc commented Mar 20, 2018

I'm submitting a...

  • Bug report
  • Feature request
  • Question

Current behavior

I have the following code:

const dbm = dbMigrate.getInstance(true, {
            cwd: './',
            env: 'dev'
});
await dbm.up(100, '');

My problem is now that the migrations are not under ./root/migrations but under ./root/build/migrations. How can I specify programatically to search in a different folder for the migrations?

But my package.json & database.json are under ./root

Environment


db-migrate version: 0.10.5

Additional information:
- Node version: 8.9.1
- Platform:  Windows

Others:

@wzrdtales
Copy link
Member

Good question and good catch!

Is not possible currently, the module branch just returns the default config currently:

} else {
internals.argv = {
get argv () {
return defaultConfig;
}
};
}

Which should be however easy to fix though.

@BorntraegerMarc
Copy link
Contributor Author

@wzrdtales should I take a shot at this or do you want to fix it? :)

@wzrdtales
Copy link
Member

Feel free to do so, PRs are always welcome :)

@wzrdtales
Copy link
Member

I would have thought of a simple Object.assign with the defaultObject and the options object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants