Skip to content

Instantly share code, notes, and snippets.

@pratikagashe
Created February 17, 2020 11:28
Show Gist options
  • Select an option

  • Save pratikagashe/c47ef564e2c3dd429c9437c150ca10cc to your computer and use it in GitHub Desktop.

Select an option

Save pratikagashe/c47ef564e2c3dd429c9437c150ca10cc to your computer and use it in GitHub Desktop.
Knex migration config file.
require('dotenv').config()
const { CLIENT, DATABASE, PG_USER, PASSWORD, HOST, PG_PORT } = process.env
module.exports = {
development: {
client: CLIENT,
connection: {
database: DATABASE,
user: PG_USER,
password: PASSWORD,
host: HOST,
port: PG_PORT,
},
migrations: {
directory: __dirname + '/db/migrations',
},
seeds: {
directory: __dirname + '/db/seeds',
},
},
staging: {
client: 'postgresql',
connection: {
database: 'my_db',
user: 'username',
password: 'password',
},
pool: {
min: 2,
max: 10,
},
migrations: {
tableName: 'knex_migrations',
},
},
production: {
client: 'postgresql',
connection: {
database: 'my_db',
user: 'username',
password: 'password',
},
pool: {
min: 2,
max: 10,
},
migrations: {
tableName: 'knex_migrations',
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment