-
Notifications
You must be signed in to change notification settings - Fork 3
/
knexfile.ts
78 lines (75 loc) · 2.17 KB
/
knexfile.ts
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
import { Knex } from 'knex';
import network from './network.json' assert { type: 'json' };
import configJson from './config.json' assert { type: 'json' };
import { Config } from './src/common';
// Update with your config settings.
const config: { [key: string]: Knex.Config } = {
development: {
client: 'pg',
migrations: {
directory: ['./migrations', './migrations/evm'],
},
connection: {
database: network.find((item) => item.chainId === configJson.chainId)
?.databaseName,
host: Config.POSTGRES_HOST,
user: Config.POSTGRES_USER,
password: Config.POSTGRES_PASSWORD,
port: Config.POSTGRES_PORT,
statement_timeout: Config.POSTGRES_STATEMENT_TIMEOUT,
},
pool: {
min: 1,
max: parseInt(Config.POSTGRES_POOL_MAX ?? '5', 10),
},
},
test: {
client: 'pg',
migrations: {
directory: ['./migrations', './migrations/evm'],
},
connection: {
database: Config.POSTGRES_DB_TEST,
host: 'localhost',
user: Config.POSTGRES_USER,
password: Config.POSTGRES_PASSWORD,
port: Config.POSTGRES_PORT,
statement_timeout: Config.POSTGRES_STATEMENT_TIMEOUT,
},
},
production: {
client: 'pg',
migrations: {
directory: ['./migrations', './migrations/evm'],
},
connection: {
database: network.find((item) => item.chainId === configJson.chainId)
?.databaseName,
host: Config.POSTGRES_HOST,
user: Config.POSTGRES_USER,
password: Config.POSTGRES_PASSWORD,
port: Config.POSTGRES_PORT,
statement_timeout: Config.POSTGRES_STATEMENT_TIMEOUT,
},
pool: {
min: 1,
max: parseInt(Config.POSTGRES_POOL_MAX ?? '5', 10),
},
},
sourcify: {
client: 'pg',
connection: {
database: Config.SOURCIFY_POSTGRES_DB,
host: Config.SOURCIFY_POSTGRES_HOST,
user: Config.SOURCIFY_POSTGRES_USER,
password: Config.SOURCIFY_POSTGRES_PASSWORD,
port: Config.SOURCIFY_POSTGRES_PORT,
statement_timeout: Config.SOURCIFY_POSTGRES_STATEMENT_TIMEOUT,
},
pool: {
min: 1,
max: parseInt(Config.SOURCIFY_POSTGRES_POOL_MAX ?? '5', 10),
},
},
};
export default config;