-
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
As per the testing done from SFAS file, data type of the following DB columns have been updated. - [x] `sims.sfas_individuals` - column `phone_number` changed to BIGINT. - [x] `sims.sfas_applications` - column `application_number` changed to BIGINT. - [x] `sims.sfas_applications` - column `gross_income_previous_year` changed to NUMERIC(10,2). - [x] Numeric transformer was used wherever required. **Note**: Type casting wasn't used in the data type conversion expecting no data in the columns. ## Rollback Evidence ![image](https://github.com/user-attachments/assets/5542ca83-c23d-4d46-a289-5647c4c54c41) ![image](https://github.com/user-attachments/assets/badebe05-e700-4ca4-a3da-cee1bb8201cb)
- Loading branch information
1 parent
7ce8ff9
commit ba12ce8
Showing
9 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...apps/db-migrations/src/migrations/1738899779713-AlterSFASIndividualExpansionColumnType.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,18 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { getSQLFileData } from "../utilities/sqlLoader"; | ||
|
||
export class AlterSFASIndividualExpansionColumnType1738899779713 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData("Alter-phone-number-type.sql", "SFASIndividuals"), | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData("Rollback-alter-phone-number-type.sql", "SFASIndividuals"), | ||
); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...pps/db-migrations/src/migrations/1738900082886-AlterSFASApplicationExpansionColumnType.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,21 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { getSQLFileData } from "../utilities/sqlLoader"; | ||
|
||
export class AlterSFASApplicationExpansionColumnType1738900082886 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData("Alter-expansion-columns-type.sql", "SFASApplications"), | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData( | ||
"Rollback-alter-expansion-columns-type.sql", | ||
"SFASApplications", | ||
), | ||
); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...ages/backend/apps/db-migrations/src/sql/SFASApplications/Alter-expansion-columns-type.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,9 @@ | ||
ALTER TABLE | ||
sims.sfas_applications | ||
ALTER COLUMN | ||
application_number TYPE BIGINT; | ||
|
||
ALTER TABLE | ||
sims.sfas_applications | ||
ALTER COLUMN | ||
gross_income_previous_year TYPE NUMERIC(10, 2); |
9 changes: 9 additions & 0 deletions
9
...end/apps/db-migrations/src/sql/SFASApplications/Rollback-alter-expansion-columns-type.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,9 @@ | ||
ALTER TABLE | ||
sims.sfas_applications | ||
ALTER COLUMN | ||
application_number TYPE INT; | ||
|
||
ALTER TABLE | ||
sims.sfas_applications | ||
ALTER COLUMN | ||
gross_income_previous_year TYPE INT; |
4 changes: 4 additions & 0 deletions
4
...s/packages/backend/apps/db-migrations/src/sql/SFASIndividuals/Alter-phone-number-type.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,4 @@ | ||
ALTER TABLE | ||
sims.sfas_individuals | ||
ALTER COLUMN | ||
phone_number TYPE BIGINT; |
4 changes: 4 additions & 0 deletions
4
...s/backend/apps/db-migrations/src/sql/SFASIndividuals/Rollback-alter-phone-number-type.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,4 @@ | ||
ALTER TABLE | ||
sims.sfas_individuals | ||
ALTER COLUMN | ||
phone_number TYPE INT; |
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