diff --git a/db/migration/1718371124648-AddGdocsPostsSlugIndex.ts b/db/migration/1718371124648-AddGdocsPostsSlugIndex.ts new file mode 100644 index 00000000000..8799ffbe257 --- /dev/null +++ b/db/migration/1718371124648-AddGdocsPostsSlugIndex.ts @@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class AddGdocsPostsSlugIndex1718371124648 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`-- sql + ALTER TABLE posts_gdocs ADD INDEX idx_posts_gdocs_slug (slug(100)); + `) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`-- sql + DROP INDEX idx_posts_gdocs_slug ON posts_gdocs; + `) + } +}