Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: addressed llm review comments

=ac617fe99720
diff --git a/backend/src/db/migrations/20260623144550_secret-folder-constraint.ts b/backend/src/db/migrations/20260623144550_secret-folder-constraint.ts
index 6af9e5c2ea..848369cd16 100644
--- a/backend/src/db/migrations/20260623144550_secret-folder-constraint.ts
+++ b/backend/src/db/migrations/20260623144550_secret-folder-constraint.ts
@@ -2,7 +2,11 @@ import { Knex } from "knex";
import { SecretType, TableName } from "../schemas";
+const MIGRATION_TIMEOUT = 60 * 1000; // 1 minute
+
export async function up(knex: Knex): Promise<void> {
+ await knex.raw(`SET LOCAL statement_timeout = ${MIGRATION_TIMEOUT}`);
+
const rankedSubquery = knex(TableName.SecretV2)
.where("type", SecretType.Shared)
.select(
diff --git a/backend/src/db/migrations/20260623144551_secret-folder-unique-index.ts b/backend/src/db/migrations/20260623144551_secret-folder-unique-index.ts
index c0de407f9c..68abc408a6 100644
--- a/backend/src/db/migrations/20260623144551_secret-folder-unique-index.ts
+++ b/backend/src/db/migrations/20260623144551_secret-folder-unique-index.ts
@@ -3,6 +3,7 @@ import { Knex } from "knex";
import { TableName } from "../schemas";
const MIGRATION_TIMEOUT = 15 * 60 * 1000; // 15 minutes
+const DROP_TIMEOUT = 60 * 1000; // 1 minute
const INDEX_NAME = "uq_secrets_v2_key_folder_id_shared";
@@ -31,7 +32,15 @@ export async function up(knex: Knex): Promise<void> {
}
export async function down(knex: Knex): Promise<void> {
- await knex.raw(`DROP INDEX IF EXISTS ${INDEX_NAME}`);
+ const result = await knex.raw("SHOW statement_timeout");
+ const originalTimeout = result.rows[0].statement_timeout;
+
+ try {
+ await knex.raw(`SET statement_timeout = ${DROP_TIMEOUT}`);
+ await knex.raw(`DROP INDEX CONCURRENTLY IF EXISTS ${INDEX_NAME}`);
+ } finally {
+ await knex.raw(`SET statement_timeout = '${originalTimeout}'`);
+ }
}
const config = { transaction: false };