I'm trying to set up a full-text search in the following environment: Node.js, Nest.js, TypeORM, and Microsoft SQL database.
The migration I'm trying to run:
import { MigrationInterface, QueryRunner } from 'typeorm';
export default class addFullTextIndexToAttachmentComments1663750544577 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`--sql
CREATE FULLTEXT CATALOG AttachmentComment
`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`--sql
DROP FULLTEXT CATALOG AttachmentComment
`);
}
}
The error I get:
QueryFailedError: Error: CREATE FULLTEXT CATALOG statement cannot be used inside a user transaction.
As I can see, typeorm queryrunner runs a transaction, but creating a catalog is not allowed inside the transaction. Is there a way to suppress transaction in typeorm queryrunner, or maybe there can be another solution?