mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
add sqlite modify chatmessage
This commit is contained in:
@@ -17,7 +17,7 @@ export class ChatMessage implements IChatMessage {
|
|||||||
@Column({ type: 'text' })
|
@Column({ type: 'text' })
|
||||||
content: string
|
content: string
|
||||||
|
|
||||||
@Column({ nullable: true })
|
@Column({ nullable: true, type: 'text' })
|
||||||
sourceDocuments?: string
|
sourceDocuments?: string
|
||||||
|
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm'
|
||||||
|
|
||||||
|
export class ModifyChatMessage1693921865247 implements MigrationInterface {
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`CREATE TABLE "temp_chat_message" ("id" varchar PRIMARY KEY NOT NULL, "role" varchar NOT NULL, "chatflowid" varchar NOT NULL, "content" text NOT NULL, "sourceDocuments" text, "createdDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||||
|
)
|
||||||
|
await queryRunner.query(
|
||||||
|
`INSERT INTO "temp_chat_message" ("id", "role", "chatflowid", "content", "sourceDocuments", "createdDate") SELECT "id", "role", "chatflowid", "content", "sourceDocuments", "createdDate" FROM "chat_message";`
|
||||||
|
)
|
||||||
|
await queryRunner.query(`DROP TABLE chat_message;`)
|
||||||
|
await queryRunner.query(`ALTER TABLE temp_chat_message RENAME TO chat_message;`)
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`DROP TABLE temp_chat_message`)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Init1693835579790 } from './1693835579790-Init'
|
import { Init1693835579790 } from './1693835579790-Init'
|
||||||
import { ModifyChatFlow1693920824108 } from './1693920824108-ModifyChatFlow'
|
import { ModifyChatFlow1693920824108 } from './1693920824108-ModifyChatFlow'
|
||||||
|
import { ModifyChatMessage1693921865247 } from './1693921865247-ModifyChatMessage'
|
||||||
|
|
||||||
export const sqliteMigrations = [Init1693835579790, ModifyChatFlow1693920824108]
|
export const sqliteMigrations = [Init1693835579790, ModifyChatFlow1693920824108, ModifyChatMessage1693921865247]
|
||||||
|
|||||||
Reference in New Issue
Block a user