diff --git a/app/plugins/Transmogrify/README.md b/app/plugins/Transmogrify/README.md index 2cceaee86..5556143ce 100644 --- a/app/plugins/Transmogrify/README.md +++ b/app/plugins/Transmogrify/README.md @@ -117,6 +117,27 @@ Hints: - Warnings and errors appear under the bar as they happen. +## Per-table skip prompt +During migration, some tables may present a prompt allowing you to skip them. When this happens, the command pauses before processing that table and asks whether you want to skip its transmogrification. +How to answer +- Type yes, true, on, or 1 to skip the table. +- Type no, false, off, or 0 to continue. +- Pressing Enter or typing anything else will continue (default: no). + +Example +```bash +Table "AuthenticationEvent" (authentication_events) may be skipped. +Skip transmogrification? yes/no [default: no] +> +``` + +If you choose to skip, you’ll see a confirmation: + +```bash +[INFO] Skipping transmogrification for table authentication_events as requested. +Transmogrifying table: Person(people) +``` + ## Mapping and hooks - Mapping is defined in config/schema/tables.json. - You can specify per‑table field maps, boolean normalization, caches, and pre/post hooks. diff --git a/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php b/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php index ab24f1729..452f8447a 100644 --- a/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php +++ b/app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php @@ -272,6 +272,24 @@ public function execute(Arguments $args, ConsoleIo $io): int } foreach(array_keys($this->tables) as $t) { + // Check per-table skip configuration and optionally prompt user + $canSkipCfg = $this->tables[$t]['canSkip'] ?? null; + if (filter_var($canSkipCfg, FILTER_VALIDATE_BOOLEAN)) { + $question = sprintf( + 'Table "%s" (%s) may be skipped.' . PHP_EOL . 'Skip transmogrification? yes/no [default: no]', + Inflector::classify($t), + $t + ); + $reply = $this->cmdPrinter->ask($question . ' '); + $replyBool = filter_var($reply, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); + if ($replyBool === true) { + $this->cmdPrinter->info(sprintf('Skipping transmogrification for table %s as requested.', $t)); + continue; + } + // Proceed for false, null, or empty responses + $this->cmdPrinter->info(sprintf('Proceeding with transmogrification for table %s.', $t)); + } + // Initializations per table migration $outboundTableEmpty = true; $skipTableTransmogrification = false;