Skip to content

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

1.7 KB
Raw Blame
import { QueryRunner } from 'typeorm'
import { Migration } from '../../migration'

export class DropChatbot1828000000000 implements Migration {
    name = 'DropChatbot1828000000000'
    breaking = true
    release = '0.88.1'
    transaction = true

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            DROP TABLE IF EXISTS "chatbot" CASCADE
        `)
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            CREATE TABLE "chatbot" (
                "id" character varying(21) NOT NULL,
                "created" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
                "updated" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
                "type" character varying NOT NULL,
                "displayName" character varying NOT NULL,
                "projectId" character varying NOT NULL,
                "connectionId" character varying,
                "dataSources" jsonb NOT NULL,
                "prompt" character varying,
                "visibilityStatus" character varying NOT NULL DEFAULT 'PRIVATE',
                CONSTRAINT "PK_1ee1961e62c5cec278314f1d68e" PRIMARY KEY ("id")
            )
        `)
        await queryRunner.query(`
            ALTER TABLE "chatbot"
            ADD CONSTRAINT "FK_d2f5f245c27541cd70f13f169eb"
            FOREIGN KEY ("projectId") REFERENCES "project"("id")
            ON DELETE NO ACTION ON UPDATE NO ACTION
        `)
        await queryRunner.query(`
            ALTER TABLE "chatbot"
            ADD CONSTRAINT "FK_13f7ad52cefa43433864732c384"
            FOREIGN KEY ("connectionId") REFERENCES "app_connection"("id")
            ON DELETE NO ACTION ON UPDATE NO ACTION
        `)
    }
}