Skip to content

Commit

Permalink
Convert NARU subtypes to question answers
Browse files Browse the repository at this point in the history
  • Loading branch information
trslater committed Sep 25, 2024
1 parent 0b73848 commit 12dd73a
Showing 1 changed file with 22 additions and 0 deletions.
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> {}
}

0 comments on commit 12dd73a

Please sign in to comment.