Skip to content

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

Fix rollback constraint

Fang-Pen Lin3916d48ba41d
diff --git a/backend/src/db/migrations/20251027234547_add-pki-acme.ts b/backend/src/db/migrations/20251027234547_add-pki-acme.ts
index 3b012c9ed1..a81b377e30 100644
--- a/backend/src/db/migrations/20251027234547_add-pki-acme.ts
+++ b/backend/src/db/migrations/20251027234547_add-pki-acme.ts
@@ -169,9 +169,9 @@ export async function down(knex: Knex): Promise<void> {
// here because knex will generate a constraint name without quotes, and it will be treated as lowercased and causing problems.
await knex.raw(
`ALTER TABLE ??
- ADD CONSTRAINT ?? CHECK (enrollmentType IN ('api', 'est'));
+ ADD CONSTRAINT ?? CHECK (?? IN ('api', 'est'));
`,
- [TableName.PkiCertificateProfile, OLD_ENROLLMENT_TYPE_CHECK_CONSTRAINT]
+ [TableName.PkiCertificateProfile, OLD_ENROLLMENT_TYPE_CHECK_CONSTRAINT, "enrollmentType"]
);
}