Files
Flowise/packages/server/src/database/migrations/postgres/1755748356008-AddChatFlowNameIndex.ts
T
Henry Heng 05763db8d3 Bugfix/Create Index Chatflow Name (#5213)
Refactor index creation for chat_flow name across multiple databases to limit indexed length to 255 characters
2025-09-15 16:54:00 +01:00

14 lines
513 B
TypeScript

import { MigrationInterface, QueryRunner } from 'typeorm'
export class AddChatFlowNameIndex1755748356008 implements MigrationInterface {
name = 'AddChatFlowNameIndex1755748356008'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE INDEX "IDX_chatflow_name" ON "chat_flow" (substring("name" from 1 for 255))`)
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_chatflow_name"`)
}
}