fix: review
This commit is contained in:
parent
f369d77b67
commit
db30355399
|
|
@ -3,7 +3,7 @@ import { MigrationInterface, QueryRunner } from 'typeorm'
|
||||||
export class AddTextToSpeechToChatFlow1759419231100 implements MigrationInterface {
|
export class AddTextToSpeechToChatFlow1759419231100 implements MigrationInterface {
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
|
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
|
||||||
if (!columnExists) queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEXT;`)
|
if (!columnExists) await queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEXT;`)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { MigrationInterface, QueryRunner } from 'typeorm'
|
||||||
export class AddTextToSpeechToChatFlow1759419216034 implements MigrationInterface {
|
export class AddTextToSpeechToChatFlow1759419216034 implements MigrationInterface {
|
||||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
|
const columnExists = await queryRunner.hasColumn('chat_flow', 'textToSpeech')
|
||||||
if (!columnExists) queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEXT;`)
|
if (!columnExists) await queryRunner.query(`ALTER TABLE \`chat_flow\` ADD COLUMN \`textToSpeech\` TEXT;`)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,13 @@ export class AddTextToSpeechToChatFlow1759419136055 implements MigrationInterfac
|
||||||
}
|
}
|
||||||
|
|
||||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
await queryRunner.query(`ALTER TABLE "chat_flow" DROP COLUMN "textToSpeech";`)
|
await queryRunner.query(`CREATE TABLE "chat_flow_temp" AS SELECT * FROM "chat_flow" WHERE 1=0;`)
|
||||||
|
await queryRunner.query(`
|
||||||
|
INSERT INTO "chat_flow_temp"
|
||||||
|
SELECT id, name, flowData, deployed, isPublic, apikeyid, chatbotConfig, apiConfig, analytic, speechToText, followUpPrompts, category, type, createdDate, updatedDate, workspaceId
|
||||||
|
FROM "chat_flow";
|
||||||
|
`)
|
||||||
|
await queryRunner.query(`DROP TABLE "chat_flow";`)
|
||||||
|
await queryRunner.query(`ALTER TABLE "chat_flow_temp" RENAME TO "chat_flow";`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue