forked from prography-TEAM-4/TEAM_4_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathormconfig.ts
25 lines (24 loc) · 868 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
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
import dotenv from 'dotenv';
import { BookList } from 'src/entities/BookList';
import { Member } from 'src/entities/Member';
import { Room } from 'src/entities/Room';
import { RoomChat } from 'src/entities/RoomChat';
import { User } from './src/entities/User';
dotenv.config();
const config: TypeOrmModuleOptions = {
type: 'mysql',
host: process.env.DB_HOST,
port: 3306,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
entities: [User, BookList, Room, RoomChat, Member],
autoLoadEntities: true,
charset: 'utf8mb4',
synchronize: false, //첫 시작은 true, 나머지는 계속 false
logging: false, //쿼리문 로그
keepConnectionAlive: true, //핫 리로딩 시 연결 차단 막기
migrationsRun: false,
};
export = config;