-
Notifications
You must be signed in to change notification settings - Fork 0
/
knexfile.ts
56 lines (50 loc) · 1.19 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
import { Knex } from 'knex';
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('dotenv').config();
const development: Knex.Config = {
client: 'pg',
connection: {
database: `${process.env.DATABASE_NAME}`,
// hostname: 'localhost',
},
migrations: {
extension: 'ts',
directory: `${__dirname}/server/data/migrations`,
tableName: 'knex_migrations',
},
seeds: {
extension: 'ts',
directory: `${__dirname}/server/data/seeds`,
},
};
const test: Knex.Config = {
client: 'pg',
connection: {
database: `${process.env.DATABASE_TEST}`,
// hostname: 'localhost',
},
migrations: {
directory: `${__dirname}/server/data/migrations`,
},
seeds: {
directory: `${__dirname}/server/data/seeds`,
},
};
const staging: Knex.Config = {
client: 'pg',
connection: {
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false },
},
pool: {
min: 2,
max: 10,
},
migrations: {
directory: `${__dirname}/server/data/migrations`,
tableName: 'knex_migrations',
},
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const config: any = { development, test, staging };
export default config;