AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { QueryRunner } from 'typeorm'
import { system } from '../../../helper/system/system'
import { AppSystemProp } from '../../../helper/system/system-props'
import { DatabaseType } from '../../database-type'
import { Migration } from '../../migration'
const isPGlite = system.get(AppSystemProp.DB_TYPE) === DatabaseType.PGLITE
export class AddRunStatusCoverIndex1777370308000 implements Migration {
name = 'AddRunStatusCoverIndex1777370308000'
breaking = false
release = '0.82.2'
transaction = false
public async up(queryRunner: QueryRunner): Promise<void> {
if (isPGlite) {
await queryRunner.query(`
CREATE INDEX IF NOT EXISTS "idx_run_project_id_environment_created_status_archived_at"
ON "flow_run" ("projectId", "environment", "created" DESC, "archivedAt", "status")
`)
}
else {
await queryRunner.query(`
CREATE INDEX CONCURRENTLY IF NOT EXISTS "idx_run_project_id_environment_created_status_archived_at"
ON "flow_run" ("projectId", "environment", "created" DESC, "archivedAt", "status")
`)
}
}
public async down(queryRunner: QueryRunner): Promise<void> {
if (isPGlite) {
await queryRunner.query('DROP INDEX IF EXISTS "idx_run_project_id_environment_created_status_archived_at"')
}
else {
await queryRunner.query('DROP INDEX CONCURRENTLY IF EXISTS "idx_run_project_id_environment_created_status_archived_at"')
}
}
}