fix pages tsv column index

This commit is contained in:
Philipinho
2024-03-23 00:12:01 +00:00
parent f1d7ffb9dd
commit 7d56920ad5
4 changed files with 11 additions and 2 deletions
@@ -4,6 +4,11 @@ export class AddTSVColumnIndex1711150345785 implements MigrationInterface {
name = 'AddTSVColumnIndex1711150345785';
public async up(queryRunner: QueryRunner): Promise<void> {
// TypeORM entity does not support custom index type
// if we don't set the index on the entity,
// TypeORM will always generate the index here in new migrations
// dropping previous index to recreate using GIN
await queryRunner.query(`DROP INDEX IF EXISTS "IDX_pages_tsv";`);
await queryRunner.query(
`CREATE INDEX "IDX_pages_tsv" ON pages USING GIN ("tsv");`,
);