Skip to content

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

fix: correct order of drop sequence

Scott Wilson7cd85cf84a80
diff --git a/backend/src/db/migrations/20240924172713_add-kms-key-project-id.ts b/backend/src/db/migrations/20240924172713_add-kms-key-project-id.ts
index deed9361b6..abf74605a4 100644
--- a/backend/src/db/migrations/20240924172713_add-kms-key-project-id.ts
+++ b/backend/src/db/migrations/20240924172713_add-kms-key-project-id.ts
@@ -30,15 +30,15 @@ export async function down(knex: Knex): Promise<void> {
// remove projectId for CMEK functionality
await knex.schema.alterTable(TableName.KmsKey, (table) => {
+ if (hasName) {
+ table.renameColumn("name", "slug");
+ }
+
if (hasOrgId) {
table.dropUnique(["orgId", "projectId", "slug"]);
table.unique(["orgId", "slug"]);
}
table.dropColumn("projectId");
-
- if (hasName) {
- table.renameColumn("name", "slug");
- }
});
}
}