module.exports = {
type: process.env.DB_DIALECT || 'postgres',
host: process.env.POSTGRES_HOST,
port: +process.env.POSTGRES_PORT,
username: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DATABASE,
entities: [path.join(__dirname, '**', '*.entity.{ts,js}')],
migrations: [
path.join(__dirname, '**', 'migration', isDev ? '*.ts' : '*.js'),
],
cli: {
migrationsDir: `./${isDev ? 'src' : 'dist'}/migration`,
},
synchronize: false,
keepConnectionAlive: isDev,
};