-
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.
Convert NARU subtypes to question answers
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...ps/alcs/src/providers/typeorm/migrations/1727304004390-convert_naru_subtype_to_answers.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 ConvertNaruSubtypeToAnswers1727304004390 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
queryRunner.query(` | ||
update alcs.application_submission as2 | ||
set | ||
naru_will_have_additional_residence = case | ||
when as2.naru_subtype_code = 'ARFU' then true | ||
end, | ||
naru_will_be_over_five_hundred_m2 = case | ||
when as2.naru_subtype_code = 'PRIN' then true | ||
end | ||
where as2.naru_subtype_code is not null | ||
and as2.naru_subtype_code <> 'TOUR'; | ||
`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> {} | ||
} |