Skip to content

Commit 6becd22

Browse files
Merge branch 'main' into dev
2 parents 6c741ac + bb1386f commit 6becd22

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

.github/workflows/production.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
jobs:
55
checkout:
66
runs-on: [self-hosted, prod]
7-
environment: dev
7+
environment: production
88
steps:
99
- name: Get code
1010
uses: actions/checkout@v4
@@ -20,7 +20,7 @@ jobs:
2020
create_env:
2121
needs: checkout
2222
runs-on: [self-hosted, prod]
23-
environment: dev
23+
environment: production
2424
steps:
2525
- name: Create .env file
2626
run: |
@@ -49,4 +49,4 @@ jobs:
4949
runs-on: [self-hosted, prod]
5050
steps:
5151
- name: Run deployment
52-
run: NODE_ENV=dev pm2 restart dist/main.js --name=events-api
52+
run: NODE_ENV=production pm2 restart dist/main.js --name=events-api

src/config/orm.config.prod.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { registerAs } from '@nestjs/config';
22
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
33
import { Event } from './../events/event.entity';
4+
import { Attendee } from 'src/events/attendee/attendee.entity';
5+
import { User } from 'src/user/user.entity';
6+
import { Profile } from 'src/auth/profile.entity';
7+
import { Subject } from 'src/school/subject.entity';
8+
import { Teacher } from 'src/school/teacher.entity';
9+
import { Course } from 'src/school/course.entity';
410

511
export default registerAs(
612
'orm.config.prod',
@@ -11,7 +17,7 @@ export default registerAs(
1117
username: process.env.DB_USER,
1218
password: process.env.DB_PASSWORD,
1319
database: process.env.DB_NAME,
14-
entities: [Event],
20+
entities: [Event, Attendee, User, Profile, Subject, Teacher, Course],
1521
synchronize: false,
1622
dropSchema: false,
1723
}),

src/config/orm.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export default registerAs(
1919
database: process.env.DB_NAME,
2020
entities: [Event, Attendee, User, Profile, Subject, Teacher, Course],
2121
synchronize: true,
22-
dropSchema: Boolean(parseInt(process.env.DB_DROP_SCHEMA)),
22+
dropSchema: Boolean(parseInt(process.env.DB_DROP_SCHEMA ?? '0')),
2323
}),
2424
);

0 commit comments

Comments
 (0)