Skip to content

Commit efb2679

Browse files
authored
Merge pull request #27 from ije90s/dev
재수정 10
2 parents b3f7e92 + 5a073cc commit efb2679

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

.github/workflows/cicd_test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ jobs:
6262
chmod 600 .env
6363
6464
npm ci --only=production
65+
66+
echo "--- 현재 위치 확인 ---"
67+
pwd
68+
69+
echo "--- 마이그레이션 파일 존재 확인 ---"
70+
ls -l dist/src/migrations || echo "파일 없음!"
71+
72+
echo "--- 마이그레이션 실행 ---"
6573
npx typeorm migration:run -d ./dist/typeorm.datasource.js
6674
6775
pm2 startOrReload ecosystem.config.js --env production

typeorm.datasource.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,13 @@ import 'dotenv/config';
22
import { DataSource } from 'typeorm';
33
import { join } from 'path';
44

5-
const isProd = process.env.NODE_ENV === 'prod';
6-
75
export default new DataSource({
86
type: 'mysql',
97
host: process.env.DB_HOST!,
108
port: Number(process.env.DB_PORT!),
119
username: process.env.DB_USER!,
1210
password: process.env.DB_PASS!,
1311
database: process.env.DB_NAME!,
14-
entities: [
15-
isProd
16-
? join(__dirname, 'src/**/entity/*.entity.js')
17-
: join(__dirname, 'src/**/entity/*.entity.ts'),
18-
],
19-
migrations: [
20-
isProd
21-
? join(__dirname, 'src/migrations/*.js')
22-
: join(__dirname, 'src/migrations/*.ts'),
23-
],
12+
entities: [join(__dirname, 'src/**/entity/*.entity.{ts,js}')],
13+
migrations: [join(__dirname, 'src/migrations/*.{ts,js}')],
2414
});

0 commit comments

Comments
 (0)