From 92d6b92f412d4b24480c9008f65b6d1439c47343 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Sat, 20 Dec 2025 09:17:16 +0000 Subject: [PATCH] Improve README.md. Fix helper tool. --- app/plugins/Transmogrify/README.md | 24 ++++++++++++++++++- .../src/Lib/Util/DbInfoPrinter.php | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/plugins/Transmogrify/README.md b/app/plugins/Transmogrify/README.md index aea5742c8..eec77fdf0 100644 --- a/app/plugins/Transmogrify/README.md +++ b/app/plugins/Transmogrify/README.md @@ -100,7 +100,7 @@ These options come directly from TransmogrifyCommand::buildOptionParser. - Dump the effective tables configuration - bin/cake transmogrify --dump-tables-config -- Migrate a subset of tables (in safe order) +- Migrate a subset of tables (in safe order) (Experimental) - bin/cake transmogrify --table types --table people --table person_roles - Use a custom tables.json mapping @@ -249,6 +249,28 @@ For every other character, use the full option: bin/cake transmogrify --groups-colon-replacement '@' ``` +## Preflight checklist: Checking transmogrified tables in the target (v5) database + +```bash +./bin/cake transmogrify --info-schema --info-schema-role target +``` +This command: +- Connects to the **target** v5 database (the `default` connection). +- Scans the database schema (e.g. `public` in PostgreSQL) and counts all real tables. +- Loads `config/schema/tables.json`, which describes the tables that are **transmogrified** from v4 to v5. +- Compares “transmogrify tables” (from `tables.json`) against the tables that exist in the v5 database and reports: + - **`Tables present (json ∧ db)`** + All tables that: + - are declared in `tables.json` (i.e. have a v4→v5 transmogrify mapping), **and** + - actually exist in the target v5 database. + +These are the tables that are “wired up” for transmogrification and present in v5. +- **`Only in database`** +Tables that exist in the v5 database but are **not** declared in `tables.json`. +These are v5 tables that currently have no transmogrify mapping from v4. + + + ## Developers ### Transmogrify SourceToTarget Command diff --git a/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php b/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php index da6616291..1af7216a8 100644 --- a/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php +++ b/app/plugins/Transmogrify/src/Lib/Util/DbInfoPrinter.php @@ -113,7 +113,7 @@ public function print(bool $asJson, bool $withPing, bool $withSchema = false, ?s $info['schema'] = $this->service->loadSchemaInfo( $alias, - $this->pluginRoot . DS . Transmogrify::TABLES_JSON_PATH); + $this->pluginRoot . DS . TransmogrifyEnum::TABLES_JSON_PATH); } catch (\Throwable $e) { $info['schema'] = [ 'error' => $e->getMessage() ]; }