mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-23 13:00:29 +03:00
preserve previous user data
This commit is contained in:
@@ -22,7 +22,7 @@ export class ChatFlow implements IChatFlow {
|
||||
@Column({ nullable: true })
|
||||
apikeyid?: string
|
||||
|
||||
@Column({ nullable: true, type: 'text' })
|
||||
@Column({ nullable: true })
|
||||
chatbotConfig?: string
|
||||
|
||||
@CreateDateColumn()
|
||||
|
||||
@@ -17,7 +17,7 @@ export class ChatMessage implements IChatMessage {
|
||||
@Column({ type: 'text' })
|
||||
content: string
|
||||
|
||||
@Column({ nullable: true, type: 'text' })
|
||||
@Column({ nullable: true })
|
||||
sourceDocuments?: string
|
||||
|
||||
@CreateDateColumn()
|
||||
|
||||
@@ -13,7 +13,7 @@ export class Credential implements ICredential {
|
||||
@Column()
|
||||
credentialName: string
|
||||
|
||||
@Column({ type: 'text' })
|
||||
@Column()
|
||||
encryptedData: string
|
||||
|
||||
@CreateDateColumn()
|
||||
|
||||
@@ -19,10 +19,10 @@ export class Tool implements ITool {
|
||||
@Column({ nullable: true })
|
||||
iconSrc?: string
|
||||
|
||||
@Column({ nullable: true, type: 'text' })
|
||||
@Column({ nullable: true })
|
||||
schema?: string
|
||||
|
||||
@Column({ nullable: true, type: 'text' })
|
||||
@Column({ nullable: true })
|
||||
func?: string
|
||||
|
||||
@CreateDateColumn()
|
||||
|
||||
@@ -3,51 +3,51 @@ import { MigrationInterface, QueryRunner } from 'typeorm'
|
||||
export class Init1693840429259 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE \`chat_flow\` (
|
||||
`CREATE TABLE IF NOT EXISTS \`chat_flow\` (
|
||||
\`id\` varchar(36) NOT NULL,
|
||||
\`name\` varchar(255) NOT NULL,
|
||||
\`flowData\` text NOT NULL,
|
||||
\`deployed\` tinyint DEFAULT NULL,
|
||||
\`isPublic\` tinyint DEFAULT NULL,
|
||||
\`apikeyid\` varchar(255) DEFAULT NULL,
|
||||
\`chatbotConfig\` text,
|
||||
\`chatbotConfig\` varchar(255) DEFAULT NULL,
|
||||
\`createdDate\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
|
||||
\`updatedDate\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;`
|
||||
)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE \`chat_message\` (
|
||||
`CREATE TABLE IF NOT EXISTS \`chat_message\` (
|
||||
\`id\` varchar(36) NOT NULL,
|
||||
\`role\` varchar(255) NOT NULL,
|
||||
\`chatflowid\` varchar(255) NOT NULL,
|
||||
\`content\` text NOT NULL,
|
||||
\`sourceDocuments\` text,
|
||||
\`sourceDocuments\` varchar(255) DEFAULT NULL,
|
||||
\`createdDate\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
|
||||
PRIMARY KEY (\`id\`),
|
||||
KEY \`IDX_e574527322272fd838f4f0f3d3\` (\`chatflowid\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;`
|
||||
)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE \`credential\` (
|
||||
`CREATE TABLE IF NOT EXISTS \`credential\` (
|
||||
\`id\` varchar(36) NOT NULL,
|
||||
\`name\` varchar(255) NOT NULL,
|
||||
\`credentialName\` varchar(255) NOT NULL,
|
||||
\`encryptedData\` text NOT NULL,
|
||||
\`encryptedData\` varchar(255) NOT NULL,
|
||||
\`createdDate\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
|
||||
\`updatedDate\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
|
||||
PRIMARY KEY (\`id\`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;`
|
||||
)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE \`tool\` (
|
||||
`CREATE TABLE IF NOT EXISTS \`tool\` (
|
||||
\`id\` varchar(36) NOT NULL,
|
||||
\`name\` varchar(255) NOT NULL,
|
||||
\`description\` text NOT NULL,
|
||||
\`color\` varchar(255) NOT NULL,
|
||||
\`iconSrc\` varchar(255) DEFAULT NULL,
|
||||
\`schema\` text,
|
||||
\`func\` text,
|
||||
\`schema\` varchar(255) DEFAULT NULL,
|
||||
\`func\` varchar(255) DEFAULT NULL,
|
||||
\`createdDate\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
|
||||
\`updatedDate\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
|
||||
PRIMARY KEY (\`id\`)
|
||||
|
||||
@@ -3,51 +3,51 @@ import { MigrationInterface, QueryRunner } from 'typeorm'
|
||||
export class Init1693891895163 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE chat_flow (
|
||||
`CREATE TABLE IF NOT EXISTS chat_flow (
|
||||
id uuid NOT NULL DEFAULT uuid_generate_v4(),
|
||||
"name" varchar NOT NULL,
|
||||
"flowData" text NOT NULL,
|
||||
deployed bool NULL,
|
||||
"isPublic" bool NULL,
|
||||
apikeyid varchar NULL,
|
||||
"chatbotConfig" text NULL,
|
||||
"chatbotConfig" varchar NULL,
|
||||
"createdDate" timestamp NOT NULL DEFAULT now(),
|
||||
"updatedDate" timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT "PK_3c7cea7d047ac4b91764574cdbf" PRIMARY KEY (id)
|
||||
);`
|
||||
)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE chat_message (
|
||||
`CREATE TABLE IF NOT EXISTS chat_message (
|
||||
id uuid NOT NULL DEFAULT uuid_generate_v4(),
|
||||
"role" varchar NOT NULL,
|
||||
chatflowid varchar NOT NULL,
|
||||
"content" text NOT NULL,
|
||||
"sourceDocuments" text NULL,
|
||||
"sourceDocuments" varchar NULL,
|
||||
"createdDate" timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT "PK_3cc0d85193aade457d3077dd06b" PRIMARY KEY (id)
|
||||
);`
|
||||
)
|
||||
await queryRunner.query(`CREATE INDEX "IDX_e574527322272fd838f4f0f3d3" ON chat_message USING btree (chatflowid);`)
|
||||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_e574527322272fd838f4f0f3d3" ON chat_message USING btree (chatflowid);`)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE credential (
|
||||
`CREATE TABLE IF NOT EXISTS credential (
|
||||
id uuid NOT NULL DEFAULT uuid_generate_v4(),
|
||||
"name" varchar NOT NULL,
|
||||
"credentialName" varchar NOT NULL,
|
||||
"encryptedData" text NOT NULL,
|
||||
"encryptedData" varchar NOT NULL,
|
||||
"createdDate" timestamp NOT NULL DEFAULT now(),
|
||||
"updatedDate" timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT "PK_3a5169bcd3d5463cefeec78be82" PRIMARY KEY (id)
|
||||
);`
|
||||
)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE tool (
|
||||
`CREATE TABLE IF NOT EXISTS tool (
|
||||
id uuid NOT NULL DEFAULT uuid_generate_v4(),
|
||||
"name" varchar NOT NULL,
|
||||
description text NOT NULL,
|
||||
color varchar NOT NULL,
|
||||
"iconSrc" varchar NULL,
|
||||
"schema" text NULL,
|
||||
func text NULL,
|
||||
"schema" varchar NULL,
|
||||
func varchar NULL,
|
||||
"createdDate" timestamp NOT NULL DEFAULT now(),
|
||||
"updatedDate" timestamp NOT NULL DEFAULT now(),
|
||||
CONSTRAINT "PK_3bf5b1016a384916073184f99b7" PRIMARY KEY (id)
|
||||
|
||||
@@ -3,17 +3,17 @@ import { MigrationInterface, QueryRunner } from 'typeorm'
|
||||
export class Init1693835579790 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "chat_flow" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "flowData" text NOT NULL, "deployed" boolean, "isPublic" boolean, "apikeyid" varchar, "chatbotConfig" text, "createdDate" datetime NOT NULL DEFAULT (datetime('now')), "updatedDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||
`CREATE TABLE IF NOT EXISTS "chat_flow" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "flowData" text NOT NULL, "deployed" boolean, "isPublic" boolean, "apikeyid" varchar, "chatbotConfig" varchar, "createdDate" datetime NOT NULL DEFAULT (datetime('now')), "updatedDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||
)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "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')));`
|
||||
`CREATE TABLE IF NOT EXISTS "chat_message" ("id" varchar PRIMARY KEY NOT NULL, "role" varchar NOT NULL, "chatflowid" varchar NOT NULL, "content" text NOT NULL, "sourceDocuments" varchar, "createdDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||
)
|
||||
await queryRunner.query(`CREATE INDEX "IDX_e574527322272fd838f4f0f3d3" ON "chat_message" ("chatflowid") ;`)
|
||||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_e574527322272fd838f4f0f3d3" ON "chat_message" ("chatflowid") ;`)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "credential" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "credentialName" varchar NOT NULL, "encryptedData" text NOT NULL, "createdDate" datetime NOT NULL DEFAULT (datetime('now')), "updatedDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||
`CREATE TABLE IF NOT EXISTS "credential" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "credentialName" varchar NOT NULL, "encryptedData" varchar NOT NULL, "createdDate" datetime NOT NULL DEFAULT (datetime('now')), "updatedDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||
)
|
||||
await queryRunner.query(
|
||||
`CREATE TABLE "tool" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "description" text NOT NULL, "color" varchar NOT NULL, "iconSrc" varchar, "schema" text, "func" text, "createdDate" datetime NOT NULL DEFAULT (datetime('now')), "updatedDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||
`CREATE TABLE IF NOT EXISTS "tool" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "description" text NOT NULL, "color" varchar NOT NULL, "iconSrc" varchar, "schema" varchar, "func" varchar, "createdDate" datetime NOT NULL DEFAULT (datetime('now')), "updatedDate" datetime NOT NULL DEFAULT (datetime('now')));`
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user