import { MigrationInterface, QueryRunner } from 'typeorm'; export class IndexRelatedPages1647313160639 implements MigrationInterface { name = 'IndexRelatedPages1647313160639'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( 'CREATE INDEX IF NOT EXISTS "related_pages_index" ON "pages" ("productFirebaseId", "retailer") ' ); await queryRunner.query( 'DROP INDEX IF EXISTS "public"."pages_related_pages_index"' ); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( 'DROP INDEX IF EXISTS "public"."related_pages_index"' ); await queryRunner.query( 'CREATE INDEX IF NOT EXISTS "pages_related_pages_index" ON "pages" ("productFirebaseId", "retailer")' ); } }