-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathormconfig.ts
More file actions
27 lines (24 loc) · 910 Bytes
/
ormconfig.ts
File metadata and controls
27 lines (24 loc) · 910 Bytes
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 { TypeOrmModuleOptions } from '@nestjs/typeorm';
import { Users } from './src/entities/user';
import { Schedules } from './src/entities/schedule';
import { LikeHistory } from './src/entities/like';
import { Item } from './src/entities/item';
import { Inventory } from './src/entities/inventory';
import { Charactors } from './src/entities/charactor';
import dotenv from 'dotenv';
dotenv.config();
const config: TypeOrmModuleOptions = {
type: 'mysql',
host: process.env.DB_HOST,
port: process.env.DB_PORT as unknown as number,
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
entities: [Users, Schedules, LikeHistory, Inventory, Item, Charactors],
synchronize: false, // 한번 true한 뒤로는 무조건 false
autoLoadEntities: true,
// charset: 'utf8mb4',
logging: true,
keepConnectionAlive: true,
};
export = config;