diff --git a/backend/typescript/migrations/20251004173456-add-reviewer-has-conflict-column.ts b/backend/typescript/migrations/20251004173456-add-reviewer-has-conflict-column.ts new file mode 100644 index 00000000..883ef1ca --- /dev/null +++ b/backend/typescript/migrations/20251004173456-add-reviewer-has-conflict-column.ts @@ -0,0 +1,20 @@ +import { DataType } from "sequelize-typescript"; +import { Migration } from "../umzug"; + +const TABLE_NAME = "reviewed_applicant_records"; + +export const up: Migration = async ({ context: sequelize }) => { + await sequelize + .getQueryInterface() + .addColumn(TABLE_NAME, "reviewerHasConflict", { + type: DataType.BOOLEAN, + allowNull: false, + defaultValue: false, + }); +}; + +export const down: Migration = async ({ context: sequelize }) => { + await sequelize + .getQueryInterface() + .removeColumn(TABLE_NAME, "reviewerHasConflict"); +}; diff --git a/backend/typescript/models/reviewedApplicantRecord.model.ts b/backend/typescript/models/reviewedApplicantRecord.model.ts index 55881955..3b012140 100644 --- a/backend/typescript/models/reviewedApplicantRecord.model.ts +++ b/backend/typescript/models/reviewedApplicantRecord.model.ts @@ -7,9 +7,9 @@ import { Model, Table, } from "sequelize-typescript"; -import User from "./user.model"; import { Review, ReviewStatus, ReviewStatusEnum } from "../types"; import ApplicantRecord from "./applicantRecord.model"; +import User from "./user.model"; @Table({ tableName: "reviewed_applicant_records" }) export default class ReviewedApplicantRecord extends Model { @@ -29,4 +29,10 @@ export default class ReviewedApplicantRecord extends Model { defaultValue: ReviewStatusEnum.TODO, }) status!: ReviewStatus; + + @Column({ + type: DataType.BOOLEAN, + defaultValue: false, + }) + reviewerHasConflict!: boolean; } diff --git a/backend/typescript/types.ts b/backend/typescript/types.ts index 02ac4122..d0d2ce5f 100644 --- a/backend/typescript/types.ts +++ b/backend/typescript/types.ts @@ -235,4 +235,5 @@ export type ReviewedApplicantRecordDTO = { reviewerId: number; review: Review; status: ReviewStatus; + reviewerHasConflict: boolean; };