Skip to content

Commit e0da4b0

Browse files
committed
INTf25-conflict-reporting-db-support: add reviewerHasConflict field into the database
1 parent 83b1a51 commit e0da4b0

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { DataType } from "sequelize-typescript";
2+
import { Migration } from "../umzug";
3+
4+
const TABLE_NAME = "reviewed_applicant_records";
5+
6+
export const up: Migration = async ({ context: sequelize }) => {
7+
await sequelize
8+
.getQueryInterface()
9+
.addColumn(TABLE_NAME, "reviewerHasConflict", {
10+
type: DataType.BOOLEAN,
11+
allowNull: false,
12+
defaultValue: false,
13+
});
14+
};
15+
16+
export const down: Migration = async ({ context: sequelize }) => {
17+
await sequelize
18+
.getQueryInterface()
19+
.removeColumn(TABLE_NAME, "reviewerHasConflict");
20+
};

backend/typescript/models/reviewedApplicantRecord.model.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import {
77
Model,
88
Table,
99
} from "sequelize-typescript";
10-
import User from "./user.model";
1110
import { Review, ReviewStatus, ReviewStatusEnum } from "../types";
1211
import ApplicantRecord from "./applicantRecord.model";
12+
import User from "./user.model";
1313

1414
@Table({ tableName: "reviewed_applicant_records" })
1515
export default class ReviewedApplicantRecord extends Model {
@@ -29,4 +29,10 @@ export default class ReviewedApplicantRecord extends Model {
2929
defaultValue: ReviewStatusEnum.TODO,
3030
})
3131
status!: ReviewStatus;
32+
33+
@Column({
34+
type: DataType.BOOLEAN,
35+
defaultValue: false,
36+
})
37+
reviewerHasConflict!: boolean;
3238
}

backend/typescript/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,5 @@ export type ReviewedApplicantRecordDTO = {
235235
reviewerId: number;
236236
review: Review;
237237
status: ReviewStatus;
238+
reviewerHasConflict: boolean;
238239
};

0 commit comments

Comments
 (0)