All files / projects-dev/apps/mc-api/src/migrations 1652222577339-UpdateSinisterMotives.ts

0% Statements 0/40
0% Branches 0/1
0% Functions 0/1
0% Lines 0/40

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41                                                                                 
import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdateSinisterMotives1652222577339 implements MigrationInterface {
    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`UPDATE packs SET releaseDate='2022-04-08' WHERE code='MC027'`);
        await queryRunner.query(`UPDATE heroes SET name='Spider-Man (Miles Morales)' WHERE id=41`);
        await queryRunner.query(`UPDATE scenarios SET name='Sandman - Hapless Pedestrians' WHERE id=27`);
        await queryRunner.query(`
            REPLACE INTO modular_sets VALUES
            (51, 'Venom Goblin', 'MC027'),
            (52, 'City in Chaos', 'MC027'),
            (53, 'Down to Earth', 'MC027'),
            (54, 'Goblin Gear', 'MC027'),
            (55, 'Guerilla Tactics', 'MC027'),
            (56, 'Osborn Tech', 'MC027'),
            (57, 'Personal Nightmare', 'MC027'),
            (58, 'Sinister Assault', 'MC027'),
            (59, 'Symbiotic Strength', 'MC027'),
            (60, 'Whispers of Paranoia', 'MC027')
        `);
        await queryRunner.query(`
            INSERT INTO scenarios_modular_sets VALUES
            (27, 52),
            (27, 53),
            (28, 59),
            (28, 53),
            (29, 57),
            (29, 60),
            (30, 55);
        `);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`UPDATE packs SET releaseDate='2022-04-30' WHERE code='MC027'`);
        await queryRunner.query(`UPDATE heroes SET name='Spider-Man' WHERE id=41`);
        await queryRunner.query(`UPDATE scenarios SET name='Sandman' WHERE id=27`);
        await queryRunner.query(`DELETE FROM scenarios_modular_sets WHERE scenarios IN (27, 28, 29, 30)`);
        await queryRunner.query(`DELETE FROM modular_sets WHERE pack='MC027'`);
    }
}