forked from kriasoft/react-firebase-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknexfile.js
47 lines (43 loc) · 1.09 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
/**
* React Starter Kit for Firebase
* https://github.com/kriasoft/react-firebase-starter
* Copyright (c) 2015-present Kriasoft | MIT License
*/
require('dotenv').config({ path: '.env.local' });
require('dotenv').config({ path: '.env' });
const fs = require('fs');
const path = require('path');
function read(file) {
const filename = path.resolve(__dirname, `ssl/${file}`);
return fs.readFileSync(filename, 'utf8');
}
// Knex configuration
// http://knexjs.org/#knexfile
module.exports = {
client: 'pg',
migrations: {
tableName: 'migrations',
},
connection: {
ssl:
(process.env.PGSSLMODE || 'disable') !== 'disable'
? {
rejectUnauthorized: false,
ca: read('server-ca.pem'),
key: read('client-key.pem'),
cert: read('client-cert.pem'),
}
: undefined,
},
// The order in which data is being saved or restored
// when you run `yarn db-save` or `yarn db-seed`.
tables: [
'users',
'user_identities',
'user_tokens',
'stories',
'story_points',
'comments',
'comment_points',
],
};