forked from TruckersMP/botranktir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknexfile.ts
38 lines (34 loc) · 910 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
import * as dotenv from 'dotenv';
// Load config variables
const config = dotenv.config({ path: '.env' });
if (config.error) {
console.error('configuration could not be parsed', config.error);
process.exit(1);
}
const connection = {
driver: process.env.DB_DRIVER,
host: process.env.DB_HOST,
port: parseInt(process.env.DB_PORT),
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
charset: process.env.DB_CHARSET,
};
module.exports = {
development: {
client: 'mysql',
connection,
migrations: {
tableName: 'knex_migrations',
directory: './database/migrations',
},
},
production: {
client: 'mysql',
connection,
migrations: {
tableName: 'knex_migrations',
directory: './database/migrations',
},
},
};