Skip to content

Commit

Permalink
Use path and __dirname in knexfile to fix running from different dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
taesup committed May 15, 2019
1 parent 0e6d3d0 commit 643aaba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/knexfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Update with your config settings.
const path = require('path');
require('dotenv').config({path: '../.env'})

module.exports = {
Expand All @@ -16,9 +17,9 @@ module.exports = {
},
migrations: {
tableName: 'knex_migrations',
directory: './database/migrations'
directory: path.join(__dirname, 'database', 'migrations')
},
seeds: {
directory: './database/seeds'
directory: path.join(__dirname, 'database', 'seeds')
}
};

0 comments on commit 643aaba

Please sign in to comment.