🐛 fix: update migration script import (#909)

This commit is contained in:
Khaled Ferjani
2025-10-15 14:09:30 +02:00
committed by GitHub
2 changed files with 8 additions and 4 deletions
@@ -162,7 +162,9 @@ const purgeIndexesCommand: yargs.CommandModule<unknown, unknown> = {
console.log(`\n✅ File migrated successfully: ${fileObject.name}`); console.log(`\n✅ File migrated successfully: ${fileObject.name}`);
} else { } else {
console.log( console.log(
`[DRY-RUN] Would migrate ${user.email_canonical} for slug ${sanitizeSlug(userId)} file: ${fileObject.name}`, `[DRY-RUN] Would migrate ${user.email_canonical} for slug ${sanitizeSlug(
userId,
)} file: ${fileObject.name}`,
); );
} }
} catch (error) { } catch (error) {
@@ -3,7 +3,7 @@ import runWithLoggerLevel from "../../utils/run-with-logger-level";
import globalResolver from "../../../services/global-resolver"; import globalResolver from "../../../services/global-resolver";
import User from "../../../services/user/entities/user"; import User from "../../../services/user/entities/user";
import yargs from "yargs"; import yargs from "yargs";
import { createCozyInstance } from "./utils"; import { createCozyInstance, sanitizeSlug } from "./utils";
import { getLDAPUserMobile } from "./utils/ldap"; import { getLDAPUserMobile } from "./utils/ldap";
const migrateUsersCommand: yargs.CommandModule<unknown, unknown> = { const migrateUsersCommand: yargs.CommandModule<unknown, unknown> = {
@@ -79,8 +79,10 @@ const migrateUsersCommand: yargs.CommandModule<unknown, unknown> = {
} }
} else { } else {
console.log( console.log(
`[DRY-RUN] Would create Cozy instance for user ${user.email_canonical} and slug ${sanitizeSlug(userId)} with the following params`, `[DRY-RUN] Would create Cozy instance for user ${
userObject user.email_canonical
} and slug ${sanitizeSlug(userId)} with the following params`,
userObject,
); );
} }
} }