-
Notifications
You must be signed in to change notification settings - Fork 738
/
Copy pathknexfile.js
67 lines (64 loc) · 1.65 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
/**
* Knex configuration file.
*
* You will not need to make changes to this file.
*/
require('dotenv').config();
const path = require("path");
const {
DATABASE_URL = "postgresql://postgres@localhost/postgres",
DATABASE_URL_DEVELOPMENT = "postgresql://postgres@localhost/postgres",
DATABASE_URL_TEST = "postgresql://postgres@localhost/postgres",
DATABASE_URL_PREVIEW = "postgresql://postgres@localhost/postgres",
DEBUG,
} = process.env;
module.exports = {
development: {
client: "postgresql",
pool: { min: 1, max: 5 },
connection: DATABASE_URL_DEVELOPMENT,
migrations: {
directory: path.join(__dirname, "src", "db", "migrations"),
},
seeds: {
directory: path.join(__dirname, "src", "db", "seeds"),
},
debug: !!DEBUG,
},
test: {
client: "postgresql",
pool: { min: 1, max: 5 },
connection: DATABASE_URL_TEST,
migrations: {
directory: path.join(__dirname, "src", "db", "migrations"),
},
seeds: {
directory: path.join(__dirname, "src", "db", "seeds"),
},
debug: !!DEBUG,
},
preview: {
client: "postgresql",
pool: { min: 1, max: 5 },
connection: DATABASE_URL_PREVIEW,
migrations: {
directory: path.join(__dirname, "src", "db", "migrations"),
},
seeds: {
directory: path.join(__dirname, "src", "db", "seeds"),
},
debug: !!DEBUG,
},
production: {
client: "postgresql",
pool: { min: 1, max: 5 },
connection: DATABASE_URL,
migrations: {
directory: path.join(__dirname, "src", "db", "migrations"),
},
seeds: {
directory: path.join(__dirname, "src", "db", "seeds"),
},
debug: !!DEBUG,
},
};