Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 21 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { MigrationInterface, QueryRunner } from "typeorm"; |
||
2 | |||
3 | export class eventEnum1669989076131 implements MigrationInterface { |
||
4 | name = 'EventEnum1669989076131' |
||
5 | |||
6 | public async up(queryRunner: QueryRunner): Promise<void> { |
||
7 | await queryRunner.query(`ALTER TYPE "public"."event_type_enum" RENAME TO "event_type_enum_old"`); |
||
8 | await queryRunner.query(`CREATE TYPE "public"."event_type_enum" AS ENUM('mission', 'support', 'dojo', 'formationConference', 'admin', 'other')`); |
||
9 | await queryRunner.query(`ALTER TABLE "event" ALTER COLUMN "type" TYPE "public"."event_type_enum" USING "type"::"text"::"public"."event_type_enum"`); |
||
10 | await queryRunner.query(`DROP TYPE "public"."event_type_enum_old"`); |
||
11 | } |
||
12 | |||
13 | public async down(queryRunner: QueryRunner): Promise<void> { |
||
14 | await queryRunner.query(`CREATE TYPE "public"."event_type_enum_old" AS ENUM('mission', 'support', 'dojo', 'formationConference', 'other')`); |
||
15 | await queryRunner.query(`ALTER TABLE "event" ALTER COLUMN "type" TYPE "public"."event_type_enum_old" USING "type"::"text"::"public"."event_type_enum_old"`); |
||
16 | await queryRunner.query(`DROP TYPE "public"."event_type_enum"`); |
||
17 | await queryRunner.query(`ALTER TYPE "public"."event_type_enum_old" RENAME TO "event_type_enum"`); |
||
18 | } |
||
19 | |||
20 | } |
||
21 |