{"action":"created","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/2862","repository_url":"https://api.github.com/repos/tgriesser/knex","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/2862/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/2862/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/2862/events","html_url":"https://github.com/tgriesser/knex/issues/2862","id":371041579,"node_id":"MDU6SXNzdWUzNzEwNDE1Nzk=","number":2862,"title":"Migrations directory problem","user":{"login":"belaarany","id":30290233,"node_id":"MDQ6VXNlcjMwMjkwMjMz","avatar_url":"https://avatars1.githubusercontent.com/u/30290233?v=4","gravatar_id":"","url":"https://api.github.com/users/belaarany","html_url":"https://github.com/belaarany","followers_url":"https://api.github.com/users/belaarany/followers","following_url":"https://api.github.com/users/belaarany/following{/other_user}","gists_url":"https://api.github.com/users/belaarany/gists{/gist_id}","starred_url":"https://api.github.com/users/belaarany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/belaarany/subscriptions","organizations_url":"https://api.github.com/users/belaarany/orgs","repos_url":"https://api.github.com/users/belaarany/repos","events_url":"https://api.github.com/users/belaarany/events{/privacy}","received_events_url":"https://api.github.com/users/belaarany/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-17T12:12:18Z","updated_at":"2018-10-17T13:41:42Z","closed_at":"2018-10-17T13:41:42Z","author_association":"NONE","body":"# Environment\r\nKnex version: 0.15.2\r\nDatabase + version: MySQL - Server version: 5.7.23-0ubuntu0.18.04.1 (Ubuntu) \r\nOS: Ubuntu 18.04.1 LTS\r\n\r\n# Bug\r\n1. I have changed the migrations' path to a different one. Then I used the `knex migrate:make` command and it created the migration file to the desired folder as I expected. So it recognizes the `directory` property within the `migration` object.\r\n\\\r\nThen I tried to run the `knex migration:latest` command and got and error (I am referencing the next section).\r\n\\\r\nHowever when I don't use the `directory` property, it works very well.\r\n\r\n2. The error message I got:\r\n```bash\r\nx@pc:~$ knex migrate:latest\r\nUsing environment: development\r\nmigration file \"20181017135233_create_users_table.js\" failed\r\nmigration failed with error: Cannot read property 'knex' of undefined\r\nTypeError: Cannot read property 'knex' of undefined\r\n    at warnPromise (/home/x/node_modules/knex/lib/migrate/index.js:423:10)\r\n    at Object.<anonymous> (/home/x/node_modules/knex/lib/migrate/index.js:370:16)\r\n    at Object.tryCatcher (/home/x/node_modules/bluebird/js/release/util.js:16:23)\r\n    at Promise._settlePromiseFromHandler (/home/x/node_modules/bluebird/js/release/promise.js:512:31)\r\n    at Promise._settlePromise (/home/x/node_modules/bluebird/js/release/promise.js:569:18)\r\n    at Promise._settlePromiseCtx (/home/x/node_modules/bluebird/js/release/promise.js:606:10)\r\n    at _drainQueueStep (/home/x/node_modules/bluebird/js/release/async.js:142:12)\r\n    at _drainQueue (/home/x/node_modules/bluebird/js/release/async.js:131:9)\r\n    at Async._drainQueues (/home/x/node_modules/bluebird/js/release/async.js:147:5)\r\n    at Immediate.Async.drainQueues (/home/x/node_modules/bluebird/js/release/async.js:17:14)\r\n    at runCallback (timers.js:794:20)\r\n    at tryOnImmediate (timers.js:752:5)\r\n    at processImmediate [as _immediateCallback] (timers.js:729:5)\r\nx@pc:~$ \r\n```\r\n3. The code I am trying to use I put below. I tried using `__dirname` as well anyways.\r\n```js\r\nrequire('dotenv').load();\r\n\r\nmodule.exports = {\r\n\r\n    development: {\r\n        client: 'mysql',\r\n        connection: {\r\n            database: process.env.DB_CONNECT_DATABASE,\r\n            user: process.env.DB_CONNECT_USER,\r\n            password: process.env.DB_CONNECT_PASSWORD\r\n        },\r\n        pool: {\r\n            min: 2,\r\n            max: 10\r\n        },\r\n        migrations: {\r\n            tableName: 'knex_migrations',\r\n            directory: \"./database/migrations\"\r\n        },\r\n        seeds: {\r\n          directory: \"./database/seeds\"\r\n        }\r\n    }\r\n\r\n};\r\n```\r\n<br />\r\n<hr />\r\n<br />\r\nAs I can see in the documentation, Knex supports the `directory` property and as I mentioned it is working when I create the migration file but It is not able to execute the migration. Am I doing something wrong or is it a bug?\r\n"},"comment":{"url":"https://api.github.com/repos/tgriesser/knex/issues/comments/430633012","html_url":"https://github.com/tgriesser/knex/issues/2862#issuecomment-430633012","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/2862","id":430633012,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDYzMzAxMg==","user":{"login":"belaarany","id":30290233,"node_id":"MDQ6VXNlcjMwMjkwMjMz","avatar_url":"https://avatars1.githubusercontent.com/u/30290233?v=4","gravatar_id":"","url":"https://api.github.com/users/belaarany","html_url":"https://github.com/belaarany","followers_url":"https://api.github.com/users/belaarany/followers","following_url":"https://api.github.com/users/belaarany/following{/other_user}","gists_url":"https://api.github.com/users/belaarany/gists{/gist_id}","starred_url":"https://api.github.com/users/belaarany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/belaarany/subscriptions","organizations_url":"https://api.github.com/users/belaarany/orgs","repos_url":"https://api.github.com/users/belaarany/repos","events_url":"https://api.github.com/users/belaarany/events{/privacy}","received_events_url":"https://api.github.com/users/belaarany/received_events","type":"User","site_admin":false},"created_at":"2018-10-17T13:41:42Z","updated_at":"2018-10-17T13:41:42Z","author_association":"NONE","body":"Thank you guys for the help!"}}
{"actor":{"display_login":"belaarany"}}