-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathknexfile.js
45 lines (44 loc) · 961 Bytes
/
knexfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const path = require('path');
require("dotenv").config(
{
path: path.join(__dirname, './.env')
}
);
/**
* @type { Object.<string, import("knex").Knex.Config> }
*/
module.exports = {
development: {
client: "pg",
connection: {
host: process.env.DB_HOST || "127.0.0.1",
port: process.env.DB_PORT || 5432,
database: process.env.DB_NAME,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
},
migrations: {
tableName: 'knex_migrations',
directory: __dirname +"/db/migrations",
},
seeds: {
directory: __dirname + "/db/seeds-development",
}
},
production: {
client: "pg",
connection: process.env.DATABASE_URL,
searchPath: 'public',
pool: {
min: 2,
max:10
},
migrations: {
tableName: 'knex_migrations',
directory: __dirname + "/db/migrations",
},
seeds: {
directory: __dirname + "/db/seeds",
}
}
};