UNPKG

399 BJavaScriptView Raw
1const fs = require('fs')
2const { NODE_ENV, DATABASE_URL, TEST_DATABASE_URL } = require('@sharyn/env')
3
4const config = {
5 client: 'pg',
6 connection: NODE_ENV === 'test' ? TEST_DATABASE_URL : DATABASE_URL,
7 migrations: { directory: './src/_db/migrations' },
8}
9
10const seedsPath = './src/_db/seeds'
11if (fs.existsSync(seedsPath)) {
12 config.seeds = { directory: seedsPath }
13}
14
15module.exports = config