Skip to content
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

Resolve configuration file path on migration #112

Merged
merged 1 commit into from Nov 26, 2013

Conversation

p-baleine
Copy link
Contributor

It changes so that the path of the migration config file is resolved before it is required.
This avoids Cannot find module error when the configuration file path is specified as relative path:

$ cd some-project/
$ cat db/config.js
// Sample Config File
module.exports = {

  directory: './migrations-folder',

  database: {
    client: 'sqlite3',
    connection: {
      filename: './db.sqlite3'
    }
  }

};
$ ./node_modules/.bin/knex migrate:make create_posts -c ./db/config.js

It changes so that the path of the migration config file is resolved before it is required.
This avoids `Cannot find module` error when the configuration file path is specified as relative path.
tgriesser added a commit that referenced this pull request Nov 26, 2013
Resolve configuration file path on migration
@tgriesser tgriesser merged commit 2cc5e99 into knex:master Nov 26, 2013
@tgriesser
Copy link
Member

Cool, thanks @p-baleine!

JakobJoonas pushed a commit to JakobJoonas/knex that referenced this pull request Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants