Skip to content

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

feat: reverted db change

=8526e6532a3b
diff --git a/backend/src/db/migrations/20260421074631_remove-rotation-v1.ts b/backend/src/db/migrations/20260421074631_remove-rotation-v1.ts
deleted file mode 100644
index 77395989d3..0000000000
--- a/backend/src/db/migrations/20260421074631_remove-rotation-v1.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { Knex } from "knex";
-
-import { TableName } from "../schemas";
-import { dropOnUpdateTrigger } from "../utils";
-
-export async function up(knex: Knex): Promise<void> {
- const hasRotationOutputTable = await knex.schema.hasTable(TableName.DeprecatedSecretRotationOutput);
- const hasRotationOutputV2Table = await knex.schema.hasTable(TableName.DeprecatedSecretRotationOutputV2);
- const hasRotationTable = await knex.schema.hasTable(TableName.DeprecatedSecretRotationV1);
-
- if (hasRotationOutputTable) await knex.schema.dropTable(TableName.DeprecatedSecretRotationOutput);
- if (hasRotationOutputV2Table) await knex.schema.dropTable(TableName.DeprecatedSecretRotationOutputV2);
-
- if (hasRotationTable) {
- await dropOnUpdateTrigger(knex, TableName.DeprecatedSecretRotationV1);
- await knex.schema.dropTableIfExists(TableName.DeprecatedSecretRotationV1);
- }
-}
-
-export async function down(): Promise<void> {}
diff --git a/backend/src/db/schemas/secret-rotation-output-v2.ts b/backend/src/db/schemas/secret-rotation-output-v2.ts
new file mode 100644
index 0000000000..28d45413a7
--- /dev/null
+++ b/backend/src/db/schemas/secret-rotation-output-v2.ts
@@ -0,0 +1,21 @@
+// Code generated by automation script, DO NOT EDIT.
+// Automated by pulling database and generating zod schema
+// To update. Just run npm run generate:schema
+// Written by akhilmhdh.
+
+import { z } from "zod";
+
+import { TImmutableDBKeys } from "./models";
+
+export const SecretRotationOutputV2Schema = z.object({
+ id: z.string().uuid(),
+ key: z.string(),
+ secretId: z.string().uuid(),
+ rotationId: z.string().uuid()
+});
+
+export type TSecretRotationOutputV2 = z.infer<typeof SecretRotationOutputV2Schema>;
+export type TSecretRotationOutputV2Insert = Omit<z.input<typeof SecretRotationOutputV2Schema>, TImmutableDBKeys>;
+export type TSecretRotationOutputV2Update = Partial<
+ Omit<z.input<typeof SecretRotationOutputV2Schema>, TImmutableDBKeys>
+>;
diff --git a/backend/src/db/schemas/secret-rotation-outputs.ts b/backend/src/db/schemas/secret-rotation-outputs.ts
new file mode 100644
index 0000000000..3ac5c2c9e9
--- /dev/null
+++ b/backend/src/db/schemas/secret-rotation-outputs.ts
@@ -0,0 +1,19 @@
+// Code generated by automation script, DO NOT EDIT.
+// Automated by pulling database and generating zod schema
+// To update. Just run npm run generate:schema
+// Written by akhilmhdh.
+
+import { z } from "zod";
+
+import { TImmutableDBKeys } from "./models";
+
+export const SecretRotationOutputsSchema = z.object({
+ id: z.string().uuid(),
+ key: z.string(),
+ secretId: z.string().uuid(),
+ rotationId: z.string().uuid()
+});
+
+export type TSecretRotationOutputs = z.infer<typeof SecretRotationOutputsSchema>;
+export type TSecretRotationOutputsInsert = Omit<z.input<typeof SecretRotationOutputsSchema>, TImmutableDBKeys>;
+export type TSecretRotationOutputsUpdate = Partial<Omit<z.input<typeof SecretRotationOutputsSchema>, TImmutableDBKeys>>;
diff --git a/backend/src/db/schemas/secret-rotations.ts b/backend/src/db/schemas/secret-rotations.ts
new file mode 100644
index 0000000000..a3cd04ebb0
--- /dev/null
+++ b/backend/src/db/schemas/secret-rotations.ts
@@ -0,0 +1,33 @@
+// Code generated by automation script, DO NOT EDIT.
+// Automated by pulling database and generating zod schema
+// To update. Just run npm run generate:schema
+// Written by akhilmhdh.
+
+import { z } from "zod";
+
+import { zodBuffer } from "@app/lib/zod";
+
+import { TImmutableDBKeys } from "./models";
+
+export const SecretRotationsSchema = z.object({
+ id: z.string().uuid(),
+ provider: z.string(),
+ secretPath: z.string(),
+ interval: z.number(),
+ lastRotatedAt: z.date().nullable().optional(),
+ status: z.string().nullable().optional(),
+ statusMessage: z.string().nullable().optional(),
+ encryptedData: z.string().nullable().optional(),
+ encryptedDataIV: z.string().nullable().optional(),
+ encryptedDataTag: z.string().nullable().optional(),
+ algorithm: z.string().nullable().optional(),
+ keyEncoding: z.string().nullable().optional(),
+ envId: z.string().uuid(),
+ createdAt: z.date(),
+ updatedAt: z.date(),
+ encryptedRotationData: zodBuffer
+});
+
+export type TSecretRotations = z.infer<typeof SecretRotationsSchema>;
+export type TSecretRotationsInsert = Omit<z.input<typeof SecretRotationsSchema>, TImmutableDBKeys>;
+export type TSecretRotationsUpdate = Partial<Omit<z.input<typeof SecretRotationsSchema>, TImmutableDBKeys>>;