-
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
## Added New Column - [x] Added new column `student_profile_snapshot` to `sims.cas_suppliers` - [x] Updated the entity model. ## Bug Fix - [x] Fixed the bug that does not associate the latest CAS SUPPLIER created to `sims.students` while adding manually the CAS SUPPLIER NUMBER and SITE CODE by ministry user. ## Rollback Evidence ![image](https://github.com/user-attachments/assets/ff8806ce-6cd0-40c3-807c-fe2f39949b98)
- Loading branch information
1 parent
99df144
commit 3225526
Showing
5 changed files
with
90 additions
and
16 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
20 changes: 20 additions & 0 deletions
20
...apps/db-migrations/src/migrations/1732666324256-AddStudentProfileSnapshotToCASSupplier.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,20 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { getSQLFileData } from "../utilities/sqlLoader"; | ||
export class AddStudentProfileSnapshotToCASSupplier1732666324256 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData("Add-student-profile-snapshot-column.sql", "CASSuppliers"), | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
getSQLFileData( | ||
"Rollback-add-student-profile-snapshot-column.sql", | ||
"CASSuppliers", | ||
), | ||
); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...s/backend/apps/db-migrations/src/sql/CASSuppliers/Add-student-profile-snapshot-column.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,6 @@ | ||
ALTER TABLE | ||
sims.cas_suppliers | ||
ADD | ||
COLUMN student_profile_snapshot jsonb; | ||
|
||
COMMENT ON COLUMN sims.cas_suppliers.student_profile_snapshot IS 'Snapshot of the student profile details which is captured when the CAS supplier is set to be valid.'; |
2 changes: 2 additions & 0 deletions
2
.../apps/db-migrations/src/sql/CASSuppliers/Rollback-add-student-profile-snapshot-column.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,2 @@ | ||
ALTER TABLE | ||
sims.cas_suppliers DROP COLUMN student_profile_snapshot; |
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