-
Notifications
You must be signed in to change notification settings - Fork 2
/
ormconfig.js
44 lines (41 loc) · 948 Bytes
/
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
40
41
42
43
44
'use strict'
require('dotenv').config()
require('pg').defaults.parseInt8 = true // By default PG returns bigint columns as strings.
const baseConfig = {
type: 'postgres',
port: 5432,
username: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
entities: [
'dist/entities/**/*.js'
],
migrations: [
'dist/migrations/**/*.js'
],
subscribers: [
'dist/subscribers/**/*.js'
],
cli: {
entitiesDir: 'src/entities',
migrationsDir: 'src/migrations',
subscribersDir: 'src/subscribers'
}
}
module.exports = {
development: {
...baseConfig,
host: '127.0.0.1',
database: 'arora_api_development',
logging: true
},
production: {
...baseConfig,
host: process.env.POSTGRES_HOST,
database: 'arora_api_production'
},
staging: {
...baseConfig,
host: process.env.POSTGRES_HOST,
database: 'arora_api_staging'
}
}[process.env.NODE_ENV ?? 'development']