Execute a transpiled hand-DDL + metadata-DML script against the working DB.
Generate native PG CodeGen for one entity (by display name), EXECUTE it against the working DB (keeping the DB current for later migrations), and return the captured SQL.
Every entity CodeGen generates objects for, in generation order — the full set
mj codegen would process (IncludeInAPI, minus excluded schemas). A baseline has
NO CodeGen banners, so MigrationSplitter.extractAffectedEntities yields []; baking
a baseline instead captures native CodeGen for THIS full set (see bakeMigration).
Refresh the in-memory metadata provider so freshly-applied entities/fields are visible.
Live-database capabilities the baker needs, injected by the caller (MJCLI wires these to
@memberjunction/codegen-lib+ apgpool). The working DB must be seeded to the state just BEFORE the migration being baked, and is left CURRENT after eachbakeMigration.