-
Notifications
You must be signed in to change notification settings - Fork 2
/
knexfile.js
57 lines (50 loc) · 1.31 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
// knexfile.js //
// Update with your config settings.
/**
* @type { Object.<string, import("knex").Knex.Config> }
*/
const parse = require('pg-connection-string').parse;
const connectionString = 'postgres://stretch_api_user:qglo1a2QR0rHymJYVuOrNukbtPVf5oWi@dpg-cj18kmk07spjv9r3q3b0-a.oregon-postgres.render.com/stretch_api';
const dbConfig = parse(connectionString);
module.exports = {
development: {
client: 'pg',
connection: {
host: dbConfig.host,
database: dbConfig.database,
user: dbConfig.user,
password: dbConfig.password,
port: dbConfig.port,
ssl: {
rejectUnauthorized: false // Set to true to reject unauthorized connections (if necessary)
}
},
migrations: {
directory: './db/migrations'
},
seeds: {
directory: './db/seeds/dev'
},
useNullAsDefault: true
},
production: {
client: 'pg',
connection: {
host: dbConfig.host,
database: dbConfig.database,
user: dbConfig.user,
password: dbConfig.password,
port: dbConfig.port,
ssl: {
rejectUnauthorized: false
}
},
migrations: {
directory: './db/migrations'
},
seeds: {
directory: './db/seeds/dev'
},
useNullAsDefault: true
},
};