Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4270 - Update the Data Types to adapt to import #4329

Merged
merged 5 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"),
);
}
}
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",
),
);
}
}
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);
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;
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;
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;
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ export class SFASIntegrationProcessingService {
for (const filePath of filePaths) {
await this.processFile(filePath, processSummary);
}
if (!filePaths.length) {
processSummary.info(
"There are no files to be processed, but post-file import operations will be executed.",
);
}
await this.postFileImportOperations(!!filePaths.length, processSummary);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ export class SFASApplication extends BaseSFASApplicationModel {
*/
@Column({
name: "application_number",
type: "bigint",
nullable: true,
transformer: numericTransformer,
})
applicationNumber?: number;

Expand Down Expand Up @@ -191,7 +193,9 @@ export class SFASApplication extends BaseSFASApplicationModel {
*/
@Column({
name: "gross_income_previous_year",
type: "numeric",
nullable: true,
transformer: numericTransformer,
})
grossIncomePreviousYear?: number;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ export class SFASIndividual extends BaseModel {
*/
@Column({
name: "phone_number",
type: "bigint",
nullable: true,
transformer: numericTransformer,
})
phoneNumber?: number;
/**
Expand Down
Loading