Skip to content

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

de duplication

x0322054ac5f36b2528
diff --git a/backend/src/db/migrations/20260603030053_pam-revamp.ts b/backend/src/db/migrations/20260603030053_pam-revamp.ts
index f7024800cd..8241fdf317 100644
--- a/backend/src/db/migrations/20260603030053_pam-revamp.ts
+++ b/backend/src/db/migrations/20260603030053_pam-revamp.ts
@@ -196,8 +196,13 @@ export async function up(knex: Knex): Promise<void> {
const projectToFolder: Record<string, string> = {};
+ const usedFolderNames = new Set<string>();
for (const project of oldPamProjects) {
- const folderName = slugify(project.name) || project.id.slice(0, 8);
+ let folderName = slugify(project.name) || project.id.slice(0, 8);
+ if (usedFolderNames.has(folderName)) {
+ folderName = `${folderName}-${project.id.slice(0, 8)}`;
+ }
+ usedFolderNames.add(folderName);
const [folder] = await knex(TableName.PamFolder)
.insert({ projectId: newProjectId, name: folderName })
.returning("id");