-
Notifications
You must be signed in to change notification settings - Fork 10
/
knexfile.js
88 lines (87 loc) · 2.14 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
require('dotenv').config();
const path = require("path");
const BASE_PATH = path.join(__dirname, "db");
module.exports = {
test: {
client: "pg",
connection: {
host: process.env.POSTGRES_HOST || "0.0.0.0",
port: process.env.POSTGRES_PORT || "5432",
user: process.env.POSTGRES_USER || "postgres",
password: process.env.POSTGRES_PASSWORD || "postgres",
database: process.env.POSTGRES_DATABASE || "workflow",
},
migrations: {
directory: path.join(BASE_PATH, "migrations"),
},
pool: {
min: 0,
max: parseInt(process.env.DB_MAX_POOL_CONNECTION ?? 10, 10),
},
seeds: {
directory: path.join(BASE_PATH, "seeds"),
},
},
docker: {
client: "pg",
connection: {
host: "flowbuild_db",
user: "postgres",
password: process.env.POSTGRES_PASSWORD || "postgres",
database: "workflow",
},
pool: {
min: 0,
max: parseInt(process.env.DB_MAX_POOL_CONNECTION ?? 10, 10),
},
migrations: {
directory: path.join(BASE_PATH, "migrations"),
},
seeds: {
directory: path.join(BASE_PATH, "seeds"),
},
},
dockerLocal: {
client: "pg",
connection: {
host: "localhost",
user: "postgres",
password: process.env.POSTGRES_PASSWORD || "postgres",
database: "workflow",
port: 5432,
},
pool: {
min: 0,
max: 40,
acquireTimeoutMillis: 60000,
idleTimeoutMillis: 600000,
},
migrations: {
directory: path.join(BASE_PATH, "migrations"),
},
seeds: {
directory: path.join(BASE_PATH, "seeds"),
},
},
prod: {
client: "pg",
connection: {
host: process.env.POSTGRES_HOST,
port: process.env.POSTGRES_PORT,
user: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DATABASE,
ssl: { rejectUnauthorized: false },
},
pool: {
min: 0,
max: parseInt(process.env.DB_MAX_POOL_CONNECTION ?? 10, 10),
},
migrations: {
directory: path.join(BASE_PATH, "migrations"),
},
seeds: {
directory: path.join(BASE_PATH, "seeds"),
},
},
};