diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1731100639156-answer_no_to_structures_for_old_soil_apps.ts b/services/apps/alcs/src/providers/typeorm/migrations/1731100639156-answer_no_to_structures_for_old_soil_apps.ts new file mode 100644 index 0000000000..67824c381c --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1731100639156-answer_no_to_structures_for_old_soil_apps.ts @@ -0,0 +1,17 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AnswerNoToStructuresForOldSoilApps1731100639156 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + queryRunner.query(` + update + alcs.application_submission as2 + set + soil_is_new_structure = false + where + as2.type_code in ('PFRS', 'POFO', 'ROSO') + and as2.soil_is_new_structure is null; + `); + } + + public async down(queryRunner: QueryRunner): Promise {} +}