Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions redisinsight/api/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,5 +265,7 @@ export default {
querySocketUrl: process.env.RI_AI_QUERY_SOCKET_URL || 'https://app-sm.k8s-cloudapi.sm-qa.qa.redislabs.com',
querySocketPath: process.env.RI_AI_QUERY_SOCKET_PATH || '/api/v1/cloud-copilot-service/socket.io/',
queryHistoryLimit: parseInt(process.env.RI_AI_QUERY_HISTORY_LIMIT, 10) || 20,
queryMaxResults: parseInt(process.env.RI_AI_QUERY_MAX_RESULTS, 10) || 50,
queryMaxNestedElements: parseInt(process.env.RI_AI_QUERY_MAX_NESTED_ELEMENTS, 10) || 25,
},
};
32 changes: 32 additions & 0 deletions redisinsight/api/migration/1718260230164-ai-history.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { MigrationInterface, QueryRunner } from "typeorm";

export class AiHistory1718260230164 implements MigrationInterface {
name = 'AiHistory1718260230164'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_51d5d60bfc249e9a20443376e1"`);
await queryRunner.query(`DROP INDEX "IDX_f0a6e0873ac71f323e9880b4a8"`);
await queryRunner.query(`DROP INDEX "IDX_5c051504f4efe6f20c5a7f64f6"`);
await queryRunner.query(`CREATE TABLE "temporary_ai_query_message" ("id" varchar PRIMARY KEY NOT NULL, "databaseId" varchar NOT NULL, "accountId" varchar NOT NULL, "type" varchar NOT NULL, "content" blob NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "encryption" varchar, "steps" blob, "conversationId" varchar)`);
await queryRunner.query(`INSERT INTO "temporary_ai_query_message"("id", "databaseId", "accountId", "type", "content", "createdAt", "encryption", "steps") SELECT "id", "databaseId", "accountId", "type", "content", "createdAt", "encryption", "steps" FROM "ai_query_message"`);
await queryRunner.query(`DROP TABLE "ai_query_message"`);
await queryRunner.query(`ALTER TABLE "temporary_ai_query_message" RENAME TO "ai_query_message"`);
await queryRunner.query(`CREATE INDEX "IDX_51d5d60bfc249e9a20443376e1" ON "ai_query_message" ("databaseId") `);
await queryRunner.query(`CREATE INDEX "IDX_f0a6e0873ac71f323e9880b4a8" ON "ai_query_message" ("accountId") `);
await queryRunner.query(`CREATE INDEX "IDX_5c051504f4efe6f20c5a7f64f6" ON "ai_query_message" ("createdAt") `);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_5c051504f4efe6f20c5a7f64f6"`);
await queryRunner.query(`DROP INDEX "IDX_f0a6e0873ac71f323e9880b4a8"`);
await queryRunner.query(`DROP INDEX "IDX_51d5d60bfc249e9a20443376e1"`);
await queryRunner.query(`ALTER TABLE "ai_query_message" RENAME TO "temporary_ai_query_message"`);
await queryRunner.query(`CREATE TABLE "ai_query_message" ("id" varchar PRIMARY KEY NOT NULL, "databaseId" varchar NOT NULL, "accountId" varchar NOT NULL, "type" varchar NOT NULL, "content" blob NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "encryption" varchar, "steps" blob)`);
await queryRunner.query(`INSERT INTO "ai_query_message"("id", "databaseId", "accountId", "type", "content", "createdAt", "encryption", "steps") SELECT "id", "databaseId", "accountId", "type", "content", "createdAt", "encryption", "steps" FROM "temporary_ai_query_message"`);
await queryRunner.query(`DROP TABLE "temporary_ai_query_message"`);
await queryRunner.query(`CREATE INDEX "IDX_5c051504f4efe6f20c5a7f64f6" ON "ai_query_message" ("createdAt") `);
await queryRunner.query(`CREATE INDEX "IDX_f0a6e0873ac71f323e9880b4a8" ON "ai_query_message" ("accountId") `);
await queryRunner.query(`CREATE INDEX "IDX_51d5d60bfc249e9a20443376e1" ON "ai_query_message" ("databaseId") `);
}

}
2 changes: 2 additions & 0 deletions redisinsight/api/migration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { CloudCapiKeys1691061058385 } from './1691061058385-cloud-capi-keys';
import { FeatureSso1691476419592 } from './1691476419592-feature-sso';
import { AiHistory1713515657364 } from './1713515657364-ai-history';
import { AiHistorySteps1714501203616 } from './1714501203616-ai-history-steps';
import { AiHistory1718260230164 } from './1718260230164-ai-history';

export default [
initialMigration1614164490968,
Expand Down Expand Up @@ -84,4 +85,5 @@ export default [
FeatureSso1691476419592,
AiHistory1713515657364,
AiHistorySteps1714501203616,
AiHistory1718260230164,
];
Loading