Skip to content

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

Update 20260205204147_redact-secret-version-values.ts

Daniel Hougaardd6fe23149113
diff --git a/backend/src/db/migrations/20260205204147_redact-secret-version-values.ts b/backend/src/db/migrations/20260205204147_redact-secret-version-values.ts
index f04ca2a33c..d03740559c 100644
--- a/backend/src/db/migrations/20260205204147_redact-secret-version-values.ts
+++ b/backend/src/db/migrations/20260205204147_redact-secret-version-values.ts
@@ -13,8 +13,10 @@ export async function up(knex: Knex): Promise<void> {
if (missingColumns) {
await knex.schema.alterTable(TableName.SecretVersionV2, (table) => {
- if (!hasParentVersionIdColumn)
+ if (!hasParentVersionIdColumn) {
table.uuid("parentVersionId").references("id").inTable(TableName.SecretVersionV2).onDelete("SET NULL");
+ table.index("parentVersionId");
+ }
if (!hasIsRedactedColumn) table.boolean("isRedacted").defaultTo(false).notNullable();
if (!hasRedactedAtColumn) table.timestamp("redactedAt").nullable();
@@ -33,10 +35,13 @@ export async function down(knex: Knex): Promise<void> {
if (hasColumns) {
await knex.schema.alterTable(TableName.SecretVersionV2, (table) => {
+ if (hasParentVersionIdColumn) {
+ table.dropIndex("parentVersionId");
+ table.dropColumn("parentVersionId");
+ }
if (hasIsRedactedColumn) table.dropColumn("isRedacted");
if (hasRedactedAtColumn) table.dropColumn("redactedAt");
if (hasRedactedByUserColumn) table.dropColumn("redactedByUserId");
- if (hasParentVersionIdColumn) table.dropColumn("parentVersionId");
});
}
}