-
Notifications
You must be signed in to change notification settings - Fork 0
/
ormconfig.ts
28 lines (24 loc) · 865 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
28
import path = require("path");
require('dotenv').config();
console.log(process.env.TY);
export = {
type: process.env.DB_TYPE,
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_NAME,
cache:false,
synchronize: process.env.ENV === 'development',
// migrationsRun: process.env.ENV != 'development',
logging: true,
entities: [path.join(__dirname, "**/*.entity{.ts,.js}")],
// entities: ["dist/entity/*.js"],
migrations: [path.join(__dirname, "src/migration/*.entity{.ts,.js}")],
cli: {
migrationsDir: 'src/migration',
entitiesDir: 'src/entities',
subscribersDir: 'src/subscriber'
},
};
// Use typeorm cli by $ npm run typeorm -- and after -- add whatever you want ....