Skip to content

Commit 6da3ca2

Browse files
committed
add score columns to applicant and reviewed applicant records
1 parent 83b1a51 commit 6da3ca2

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { DataType } from "sequelize-typescript";
2+
import { Migration } from "../umzug";
3+
4+
export const up: Migration = async ({ context: sequelize }) => {
5+
await sequelize
6+
.getQueryInterface()
7+
.addColumn("reviewed_applicant_records", "combined_score", {
8+
type: DataType.INTEGER,
9+
allowNull: true,
10+
defaultValue: null,
11+
});
12+
13+
await sequelize.getQueryInterface().addColumn("applicant_records", "score", {
14+
type: DataType.INTEGER,
15+
allowNull: true,
16+
defaultValue: null,
17+
});
18+
};
19+
20+
export const down: Migration = async ({ context: sequelize }) => {
21+
await sequelize
22+
.getQueryInterface()
23+
.removeColumn("reviewed_applicant_records", "combined_score");
24+
25+
await sequelize
26+
.getQueryInterface()
27+
.removeColumn("applicant_records", "score");
28+
};

backend/typescript/models/applicantRecord.model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,11 @@ export default class ApplicantRecord extends Model {
4747

4848
@Column({ type: DataType.JSONB, allowNull: true })
4949
extraInfo!: ApplicantRecordExtraInfo;
50+
51+
@Column({
52+
type: DataType.INTEGER,
53+
allowNull: true,
54+
defaultValue: null,
55+
})
56+
score!: number;
5057
}

backend/typescript/models/reviewedApplicantRecord.model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,11 @@ export default class ReviewedApplicantRecord extends Model {
2929
defaultValue: ReviewStatusEnum.TODO,
3030
})
3131
status!: ReviewStatus;
32+
33+
@Column({
34+
type: DataType.INTEGER,
35+
allowNull: true,
36+
defaultValue: null,
37+
})
38+
combined_score!: number;
3239
}

0 commit comments

Comments
 (0)