Skip to content

Commit

Permalink
Merge pull request #3713 from owid/db-gdocs-slug-index
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber authored Jun 18, 2024
2 parents 5e19bdb + 11eca13 commit 32302d7
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 32302d7

Please sign in to comment.