forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolves issues around markedAsDuplicate (bloom-housing#3373)
- Loading branch information
1 parent
0c1f08a
commit 3b62233
Showing
3 changed files
with
31 additions
and
12 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
22 changes: 22 additions & 0 deletions
22
backend/core/src/migration/1680216626425-fixing-marked-as-duplicate-flag.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,22 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
|
||
export class fixingMarkedAsDuplicateFlag1680216626425 implements MigrationInterface { | ||
name = "fixingMarkedAsDuplicateFlag1680216626425" | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
// if review status is duplicate markedAsDuplicate should be true | ||
await queryRunner.query(` | ||
UPDATE applications | ||
SET marked_as_duplicate = true | ||
WHERE review_status = 'duplicate' | ||
`) | ||
// if review status is not duplicate markedAsDuplicate should be false | ||
await queryRunner.query(` | ||
UPDATE applications | ||
SET marked_as_duplicate = false | ||
WHERE review_status != 'duplicate' | ||
`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> {} | ||
} |