Form-Service/src/config/database.config.ts

40 lines
1.3 KiB
TypeScript

// src/config/database.config.ts
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { Participant } from '../participant/entity/participant.entity';
import { Form } from '../form/entity/form.entity';
import { Realm } from '../realm/entity/realm.entity';
import { Question } from '../question/entity/question.entity';
import { Answer } from '../answer/entity/answer.entity';
import { Option } from '../option/entity/option.entity';
import { Attachment } from '../attachment/entity/attachment.entity';
import { FormSection } from '../formSection/entity/formSection.entity';
import { FormPage } from '../formPage/entity/formPage.entity';
import { FormResult } from '../formResult/entity/formResult.entity';
import { ParticipantGroup } from '../participantGroup/entity/participantGroup.entity';
import { BaseEntity, Metadata } from '../_core/entity/_base.entity';
export const typeOrmConfig: TypeOrmModuleOptions = {
type: 'postgres',
host: 'localhost',
port: 5433,
username: 'postgres',
password: '1111',
database: 'db',
entities: [
BaseEntity,
Participant,
Metadata,
Form,
Realm,
Question,
Answer,
Option,
Attachment,
FormSection,
FormPage,
FormResult,
ParticipantGroup,
],
synchronize: true,
logging: true,
};