Skip to content

Commit

Permalink
db: add index on posts_gdocs.slug column
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Jun 14, 2024
1 parent f5071dd commit 11eca13
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions db/migration/1718371124648-AddGdocsPostsSlugIndex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { MigrationInterface, QueryRunner } from "typeorm"

export class AddGdocsPostsSlugIndex1718371124648 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
ALTER TABLE posts_gdocs ADD INDEX idx_posts_gdocs_slug (slug(100));
`)
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`-- sql
DROP INDEX idx_posts_gdocs_slug ON posts_gdocs;
`)
}
}

0 comments on commit 11eca13

Please sign in to comment.