-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update student gender options.
- Loading branch information
1 parent
6f5c263
commit 23accef
Showing
16 changed files
with
117 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...s/packages/backend/apps/db-migrations/src/migrations/1718050524263-UpdateGenderOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { getSQLFileData } from "../utilities/sqlLoader"; | ||
|
||
export class UpdateGenderOptions1718050524263 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData("Update-gender-options.sql", "Student"), | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData("Rollback-update-gender-options.sql", "Student"), | ||
); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...es/packages/backend/apps/db-migrations/src/sql/Student/Rollback-update-gender-options.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'male' | ||
WHERE | ||
gender = 'man'; | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'diverse' | ||
WHERE | ||
gender = 'nonBinary'; | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'female' | ||
WHERE | ||
gender = 'woman'; | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'unknown' | ||
WHERE | ||
gender = 'preferNotToAnswer'; | ||
|
||
ALTER TABLE | ||
sims.students | ||
ALTER COLUMN | ||
gender TYPE varchar(10); |
39 changes: 39 additions & 0 deletions
39
sources/packages/backend/apps/db-migrations/src/sql/Student/Update-gender-options.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
ALTER TABLE | ||
sims.students | ||
ALTER COLUMN | ||
gender TYPE varchar(50); | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'man' | ||
WHERE | ||
gender = 'male'; | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'nonBinary' | ||
WHERE | ||
gender = 'X'; | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'nonBinary' | ||
WHERE | ||
gender = 'diverse'; | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'woman' | ||
WHERE | ||
gender = 'female'; | ||
|
||
UPDATE | ||
sims.students | ||
SET | ||
gender = 'preferNotToAnswer' | ||
WHERE | ||
gender = 'unknown'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,7 +113,7 @@ describe( | |
`2000000001000900000000PABCD19950630${processDateFormatted}Doe John MMAddress Line 1 Address Line 2 Calgary AB H1H 1H1 Canada [email protected] PT `, | ||
); | ||
expect(msfaaPartTimeOtherCountry).toBe( | ||
`2000000001001900000001PEFDG20000101${processDateFormatted}Other Doe Jane OSAddress Line 1 Some city on United State United States [email protected] PT `, | ||
`2000000001001900000001PEFDG20000101${processDateFormatted}Other Doe Jane SAddress Line 1 Some city on United State United States [email protected] PT `, | ||
); | ||
expect(msfaaPartTimeRelationshipOther).toBe( | ||
`2000000001002900000002PIHKL20011231${processDateFormatted}Other Doe Other John FOAddress Line 1 Address Line 2 Victoria BC H1H 1H1 Canada [email protected] PT `, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,7 @@ describe("ECertFullTimeIntegrationService-createRequestContent", () => { | |
provinceState: "BC", | ||
postalCode: "V1V1V1", | ||
email: "[email protected]", | ||
gender: "male", | ||
gender: "man", | ||
calculatedPDPPDStatus: true, | ||
maritalStatus: RelationshipStatus.Other, | ||
studentNumber: "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,7 @@ describe("ECertPartTimeIntegrationService-createRequestContent", () => { | |
provinceState: "BC", | ||
postalCode: "V1V1V1", | ||
email: "[email protected]", | ||
gender: "male", | ||
gender: "man", | ||
calculatedPDPPDStatus: true, | ||
maritalStatus: RelationshipStatus.Other, | ||
studentNumber: "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ export const APPLICATION_SUBMISSION_PAYLOAD = { | |
studentHomeAddress: "123 Humboldt St, Victoria, BC, V9V1V1, canada", | ||
studentEmail: "[email protected]", | ||
studentLastName: "FRANKY", | ||
studentGender: "male", | ||
studentGender: "man", | ||
studentPhoneNumber: "7789221234", | ||
disabilityStatus: "Requested", | ||
studentInfoConfirmed: true, | ||
|