-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
knexfile.ts
40 lines (37 loc) · 958 Bytes
/
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
// configuratin file for knex cli tool
import "dotenv/config";
import type { Knex } from "knex";
const development: Knex.Config = {
client: "pg",
connection: {
host: process.env.PGHOST,
port: Number(process.env.PGPORT),
user: process.env.PGUSER,
password: process.env.PGPASSWORD,
database: "time_climb",
},
migrations: {
directory: "./database/migrations",
extension: "ts",
},
seeds: {
directory: "./database/seeds",
},
pool: { min: 2, max: 10 }, // can be optimized later, these are default values
debug: true,
};
const production: Knex.Config = {
client: "pg",
connection: process.env.DATABASE_URL,
migrations: {
directory: "./database/migrations",
extension: "ts",
},
pool: { min: 2, max: 10 }, // can be optimized later, these are default values
debug: false,
};
const knexCliConfig: { [key: string]: Knex.Config } = {
development,
production,
};
export default knexCliConfig;