-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathormconfig.ts
27 lines (25 loc) · 858 Bytes
/
ormconfig.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
import * as dotenv from 'dotenv';
import { join } from 'path';
import { DataSource, DataSourceOptions } from 'typeorm';
dotenv.config({
path: './.env',
});
module.exports = {
type: process.env.DATABASE_TYPE,
host: process.env.DATABASE_HOST,
port: process.env.DATABASE_PORT,
username: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
database: process.env.DATABASE_NAME,
synchronize: false,
logging: false,
entities: ['dist/**/entities/*.entity.{ts,js}'],
migrations: ['dist/migration/**/*.{js,ts}'],
subscribers: ['src/subscriber/**/*.{js,ts}'],
// specify the directory with which all our migration, entity and subscription files will be created when we run their respective cli command
cli: {
entitiesDir: 'src/entity',
migrationsDir: 'src/migration',
subscribersDir: 'src/subscriber',
},
};