-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathormconfig.ts
41 lines (38 loc) · 1.27 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import * as dotenv from 'dotenv';
import { Assignment } from './src/assignment/types/assignment.entity';
import { Question } from './src/question/types/question.entity';
import { SurveyTemplate } from './src/surveyTemplate/types/surveyTemplate.entity';
import { User } from './src/user/types/user.entity';
import { Youth } from './src/youth/types/youth.entity';
import { Reviewer } from './src/reviewer/types/reviewer.entity';
import { Option } from './src/option/types/option.entity';
import { Response } from './src/response/types/response.entity';
import { Survey } from './src/survey/types/survey.entity';
dotenv.config();
const config: TypeOrmModuleOptions & { seeds: string[] } = {
type: 'postgres',
host: process.env.POSTGRES_HOST,
port: Number(process.env.POSTGRES_PORT),
username: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
database: process.env.POSTGRES_DATABASE,
entities: [
User,
Survey,
SurveyTemplate,
Question,
Option,
Assignment,
Response,
Youth,
Reviewer,
],
migrationsTableName: 'migrations',
migrations: ['dist/migrations/*.js'],
cli: {
migrationsDir: 'migrations',
},
seeds: ['src/seeds/**/*{.ts,.js}'],
};
export default config;