forked from freeCodeCamp/chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathormconfig.js
More file actions
29 lines (26 loc) · 782 Bytes
/
ormconfig.js
File metadata and controls
29 lines (26 loc) · 782 Bytes
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
/* eslint-disable @typescript-eslint/no-var-requires */
const { config } = require('dotenv');
config();
const dbConfig = {
host: process.env.DB_URL,
port: process.env.DB_PORT || (process.env.IS_DOCKER === '' ? 5432 : 54320),
username: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
};
module.exports = {
type: 'postgres',
...dbConfig,
synchronize: false,
logging: false,
entities: ['server/models/**/*.ts'],
factories: ['server/factories/**/*.factory.ts'],
migrations: ['server/migrations/**/*.ts'],
seeds: ['server/seeds/**/*.seed.ts'],
subscribers: ['src/subscriber/**/*.ts'],
cli: {
entitiesDir: 'server/models',
migrationsDir: 'server/migrations',
subscribersDir: 'server/subscriber',
},
};