forked from squareboat/nestjs-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknexfile.ts
30 lines (29 loc) · 759 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
import 'dotenv/config';
import * as Knex from 'knex';
import { knexSnakeCaseMappers } from 'objection';
module.exports = {
client: process.env.DB_TYPE || 'mysql2',
debug: !!+process.env.DB_DEBUG,
connection: {
host: process.env.DB_HOST,
port: process.env.DB_PORT,
database: process.env.DB_DATABASE,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
charset: 'utf8',
},
useNullAsDefault: true,
pool: {
min: 2,
max: 10,
},
migrations: {
tableName: 'migrations',
directory: './src/_db/migrations',
extension: 'ts',
},
seeds: {
directory: './src/_db/seeds',
},
...knexSnakeCaseMappers(),
} as Knex.Config;