Skip to content

Commit cd62d30

Browse files
committed
merge main
2 parents c2fc0f6 + 5619d28 commit cd62d30

File tree

6 files changed

+79
-7
lines changed

6 files changed

+79
-7
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
.removeColumn("applicant_records", "selectedForInterview");
8+
};
9+
10+
export const down: Migration = async ({ context: sequelize }) => {
11+
await sequelize
12+
.getQueryInterface()
13+
.addColumn("applicant_records", "selectedForInterview", {
14+
type: DataType.BOOLEAN,
15+
allowNull: false,
16+
defaultValue: false,
17+
});
18+
};
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { Migration } from "../umzug";
2+
3+
const USER_SEED_DATA = [
4+
{
5+
first_name: "Carolyn",
6+
last_name: "Zhang",
7+
email: "carolynzhang@uwblueprint.org",
8+
auth_id: "ATd5GMzp8IPJzQzuQYkaavcelb32",
9+
role: "Admin",
10+
position: "VP Engineering",
11+
},
12+
{
13+
first_name: "Jesse",
14+
last_name: "Huang",
15+
email: "jessehuang@uwblueprint.org",
16+
auth_id: "dkXIhkZXljOuEsXrZDASEguCQw43",
17+
role: "Admin",
18+
position: "VP Engineering",
19+
},
20+
];
21+
22+
const PREVIOUS_USER_SEED_DATA = [
23+
{
24+
first_name: "John",
25+
last_name: "Doe",
26+
email: "johndoe@gmail.com",
27+
auth_id: "bide",
28+
role: "User",
29+
},
30+
{
31+
first_name: "Jane",
32+
last_name: "Doe",
33+
email: "janedoe@gmail.ca",
34+
auth_id: "none",
35+
role: "Admin",
36+
},
37+
];
38+
39+
export const up: Migration = async ({ context: sequelize }) => {
40+
// Update user with id 1
41+
await sequelize
42+
.getQueryInterface()
43+
.bulkUpdate("users", USER_SEED_DATA[0], { id: 1 });
44+
// Update user with id 2
45+
await sequelize
46+
.getQueryInterface()
47+
.bulkUpdate("users", USER_SEED_DATA[1], { id: 2 });
48+
};
49+
50+
export const down: Migration = async ({ context: sequelize }) => {
51+
// Revert user with id 1
52+
await sequelize
53+
.getQueryInterface()
54+
.bulkUpdate("users", PREVIOUS_USER_SEED_DATA[0], { id: 1 });
55+
// Revert user with id 2
56+
await sequelize
57+
.getQueryInterface()
58+
.bulkUpdate("users", PREVIOUS_USER_SEED_DATA[1], { id: 2 });
59+
};

backend/typescript/models/applicant.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { Column, DataType, Model, Table } from "sequelize-typescript";
44

5-
@Table({ tableName: "applicantresponse" })
5+
@Table({ tableName: "applicants" })
66
export default class Applicant extends Model {
77
@Column({
88
type: DataType.INTEGER,

backend/typescript/models/applicantRecord.model.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import Applicant from "./applicant.model";
1616
import Position from "./position.model";
1717

18-
@Table({ tableName: "applicantresponse" })
18+
@Table({ tableName: "applicant_records" })
1919
export default class ApplicantRecord extends Model {
2020
@Column({
2121
type: DataType.INTEGER,
@@ -45,9 +45,6 @@ export default class ApplicantRecord extends Model {
4545
@Column({ type: DataType.STRING, allowNull: true })
4646
skillCategory!: SkillCategory;
4747

48-
@Column({ type: DataType.BOOLEAN })
49-
selectedForInterview!: boolean;
50-
5148
@Column({ type: DataType.JSONB, allowNull: true })
5249
extraInfo!: ApplicantRecordExtraInfo;
5350
}

backend/typescript/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export type ApplicantRecordDTO = {
103103
roleSpecificQuestions: string[];
104104
choice: number;
105105
status: ApplicationStatus;
106-
selectedForInterview: boolean;
107106
skillCategory?: SkillCategory;
108107
};
109108

@@ -229,7 +228,6 @@ export type Review = {
229228
desireToLearn?: number;
230229
skill?: number;
231230
skillCategory?: SkillCategory;
232-
comments?: string;
233231
};
234232

235233
export type ReviewedApplicantRecordDTO = {

0 commit comments

Comments
 (0)