Skip to content

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

restrict gateway deletion

x0322055e2bec205c38
diff --git a/backend/src/db/migrations/20260219070359_pam-discovery.ts b/backend/src/db/migrations/20260219070359_pam-discovery.ts
index acc5b26e63..98a760c6fc 100644
--- a/backend/src/db/migrations/20260219070359_pam-discovery.ts
+++ b/backend/src/db/migrations/20260219070359_pam-discovery.ts
@@ -18,7 +18,7 @@ export async function up(knex: Knex): Promise<void> {
t.string("discoveryType").notNullable();
t.uuid("gatewayId").notNullable();
- t.foreign("gatewayId").references("id").inTable(TableName.GatewayV2).onDelete("SET NULL");
+ t.foreign("gatewayId").references("id").inTable(TableName.GatewayV2).onDelete("RESTRICT");
t.index("gatewayId");
t.binary("encryptedDiscoveryCredentials").notNullable();