-
Notifications
You must be signed in to change notification settings - Fork 0
/
ormconfig.js
39 lines (37 loc) · 1.07 KB
/
ormconfig.js
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
const devConfig = {
type: 'postgres',
host: process.env.DEV_DB_HOST,
port: process.env.DEV_DB_PORT,
username: process.env.DEV_DB_USER,
password: process.env.DEV_DB_PASS,
database: process.env.DEV_DB_NAME,
synchronize: true,
logging: false,
entities: ['src/entities/**/*.ts'],
migrations: ['src/migrations/**/*.ts'],
subscribers: ['src/subscribers/**/*.ts'],
cli: {
entitiesDir: 'src/entities',
migrationsDir: 'src/migrations',
subscribersDir: 'src/subscribers',
},
};
const testConfig = {
type: 'postgres',
host: process.env.TEST_DB_HOST,
port: process.env.TEST_DB_PORT,
username: process.env.TEST_DB_USER,
password: process.env.TEST_DB_PASS,
database: process.env.TEST_DB_NAME,
synchronize: true,
logging: false,
entities: ['src/entities/**/*.ts'],
migrations: ['src/migrations/**/*.ts'],
subscribers: ['src/subscribers/**/*.ts'],
cli: {
entitiesDir: 'src/entities',
migrationsDir: 'src/migrations',
subscribersDir: 'src/subscribers',
},
};
module.exports = process.env.NODE_ENV === 'test' ? testConfig : devConfig;