generated from NarHakobyan/awesome-nest-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ormconfig.ts
27 lines (23 loc) · 925 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 './src/boilerplate.polyfill';
import type { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { UserSubscriber } from './src/entity-subscribers/user-subscriber';
import { SnakeNamingStrategy } from './src/snake-naming.strategy';
const configs: TypeOrmModuleOptions & { seeds: string[]; factories: string[] } =
{
type: 'postgres',
host: process.env.DB_HOST,
port: Number(process.env.DB_PORT),
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
namingStrategy: new SnakeNamingStrategy(),
subscribers: [UserSubscriber],
entities: [
'src/modules/**/*.entity{.ts,.js}',
'src/modules/**/*.view-entity{.ts,.js}',
],
migrations: ['src/database/migrations/*{.ts,.js}'],
seeds: ['src/database/seeds/**/*{.ts,.js}'],
factories: ['src/database/factories/**/*{.ts,.js}'],
};
module.exports = configs;