-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
knexfile.ts
28 lines (21 loc) · 1.13 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
//----------------------------------------------------------------------------------------------------------------------
// Knex Migration configuration
//----------------------------------------------------------------------------------------------------------------------
import 'dotenv/config';
import configUtil from '@strata-js/util-config';
import type { Knex } from 'knex';
import { ServerConfig } from './src/server/interfaces/config';
//----------------------------------------------------------------------------------------------------------------------
const env = (process.env.ENVIRONMENT ?? 'local').toLowerCase();
configUtil.load(`./config/${ env }.yml`);
//----------------------------------------------------------------------------------------------------------------------
module.exports = {
...configUtil.get<ServerConfig>().database ?? {},
migrations: {
directory: './src/server/knex/migrations',
},
seeds: {
directory: './src/server/knex/seeds',
},
} satisfies Knex.Config;
//----------------------------------------------------------------------------------------------------------------------