Skip to content

Commit 511f350

Browse files
committed
switch score/combined_score columns in applicant/reviewed applicant records
1 parent f428132 commit 511f350

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

backend/typescript/migrations/20251004173612-update-db-with-scores-col.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,27 @@ const APP_TABLE = "applicant_records";
77
export const up: Migration = async ({ context: sequelize }) => {
88
await sequelize
99
.getQueryInterface()
10-
.addColumn(REV_APP_TABLE, "combined_score", {
10+
.addColumn(REV_APP_TABLE, "score", {
1111
type: DataType.INTEGER,
1212
allowNull: true,
1313
defaultValue: null,
1414
});
1515

16-
await sequelize.getQueryInterface().addColumn(APP_TABLE, "score", {
17-
type: DataType.INTEGER,
18-
allowNull: true,
19-
defaultValue: null,
16+
await sequelize
17+
.getQueryInterface()
18+
.addColumn(APP_TABLE, "combined_score", {
19+
type: DataType.INTEGER,
20+
allowNull: true,
21+
defaultValue: null,
2022
});
2123
};
2224

2325
export const down: Migration = async ({ context: sequelize }) => {
2426
await sequelize
2527
.getQueryInterface()
26-
.removeColumn("reviewed_applicant_records", "combined_score");
28+
.removeColumn("reviewed_applicant_records", "score");
2729

2830
await sequelize
2931
.getQueryInterface()
30-
.removeColumn("applicant_records", "score");
32+
.removeColumn("applicant_records", "combined_score");
3133
};

backend/typescript/models/applicantRecord.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ export default class ApplicantRecord extends Model {
5353
allowNull: true,
5454
defaultValue: null,
5555
})
56-
score!: number;
56+
combined_score!: number;
5757
}

backend/typescript/models/reviewedApplicantRecord.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ export default class ReviewedApplicantRecord extends Model {
3535
allowNull: true,
3636
defaultValue: null,
3737
})
38-
combined_score!: number;
38+
score!: number;
3939
}

backend/typescript/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export type ApplicantRecordDTO = {
104104
choice: number;
105105
status: ApplicationStatus;
106106
skillCategory?: SkillCategory;
107-
score?: number | null;
107+
combined_score?: number | null;
108108
};
109109

110110
export type ApplicationStatus =
@@ -236,5 +236,5 @@ export type ReviewedApplicantRecordDTO = {
236236
reviewerId: number;
237237
review: Review;
238238
status: ReviewStatus;
239-
combined_score?: number | null;
239+
score?: number | null;
240240
};

0 commit comments

Comments
 (0)