fix: followUpPrompts migration for MariaDB (#3677)

This commit is contained in:
Karlo Benčić 2024-12-11 18:54:16 +01:00 committed by GitHub
parent 99d4bacd8a
commit 13fb0f1384
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -4,11 +4,12 @@ export class AddFollowUpPrompts1726666318346 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const columnExistsInChatflow = await queryRunner.hasColumn('chat_flow', 'followUpPrompts')
if (!columnExistsInChatflow) queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`followUpPrompts\` TEXT;`)
const columnExistsInChatMessage = await queryRunner.hasColumn('chat_flow', 'followUpPrompts')
if (!columnExistsInChatMessage) queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`followUpPrompts\` TEXT;`)
const columnExistsInChatMessage = await queryRunner.hasColumn('chat_message', 'followUpPrompts')
if (!columnExistsInChatMessage) queryRunner.query(`ALTER TABLE \`chat_message\` ADD COLUMN \`followUpPrompts\` TEXT;`)
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE \`chat_flow\` DROP COLUMN \`followUpPrompts\`;`)
await queryRunner.query(`ALTER TABLE \`chat_message\` DROP COLUMN \`followUpPrompts\`;`)
}
}