Skip to content

Commit

Permalink
Add support to skip certain tables during transmogrification
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Nov 15, 2025
1 parent b4983c7 commit 98ef111
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/plugins/Transmogrify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 18 additions & 0 deletions app/plugins/Transmogrify/src/Command/TransmogrifyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 98ef111

Please sign in to comment.