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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | import { MigrationInterface, QueryRunner } from "typeorm"; export class AddCustomHeroes1633351069002 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise<void> { await queryRunner.query(` ALTER TABLE packs CHANGE type type ENUM('Core','Scenario','Hero','Print and Play','Expansion','Custom') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL; `); await queryRunner.query(` REPLACE INTO packs VALUES ('CUS01', 'Superman', 'Custom', '2021-10-04'), ('CUS02', 'Aquaman', 'Custom', '2021-10-04'), ('CUS03', 'Wonder Woman', 'Custom', '2021-10-04'), ('CUS04', 'Ironheart', 'Custom', '2021-10-04'), ('CUS05', 'Deadpool', 'Custom', '2021-10-04'); `); await queryRunner.query(` ALTER TABLE heroes CHANGE aspects aspects SET('Aggression','Justice','Protection','Leadership') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL; `); await queryRunner.query(` REPLACE INTO heroes (id, name, alterEgo, aspects, packCode) VALUES (30, 'Superman', 'Clark Kent', null, 'CUS01'), (31, 'Aquaman', 'Arthur Curry', null, 'CUS02'), (32, 'Wonder Woman', 'Diana of Themyscira', null, 'CUS03'), (33, 'Ironheart', 'Riri Williams', null, 'CUS04'), (34, 'Deadpool', 'Wade Wilson', null, 'CUS05'); `); await queryRunner.query(` UPDATE heroes SET aspects='Justice' WHERE id=9; `); await queryRunner.query(` UPDATE modular_sets SET packCode='MC024' WHERE id IN(30, 31, 32, 33, 34, 35, 36, 37, 38); `); await queryRunner.query(` UPDATE scenarios SET packCode='MC024' WHERE id=23; `); await queryRunner.query(`UPDATE packs SET releaseDate='2021-10-15' WHERE code='MC023'`); } public async down(queryRunner: QueryRunner): Promise<void> { await queryRunner.query(` DELETE FROM heroes WHERE packCode IN ('CUS01', 'CUS02', 'CUS03', 'CUS04', 'CUS05'); `); await queryRunner.query(` DELETE FROM packs WHERE code IN ('CUS01', 'CUS02', 'CUS03', 'CUS04', 'CUS05'); `); await queryRunner.query(` ALTER TABLE packs CHANGE type type ENUM('Core','Scenario','Hero','Print and Play','Expansion') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL; `); await queryRunner.query(` ALTER TABLE heroes CHANGE aspects aspects SET('Aggression','Justice','Protection','Leadership') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL; `); } } |