Skip to content

Migrator

renameSystemTables()

renameSystemTables() — returns struct

Available in: migrator Category: General Functions

F15 Phase 2: rename legacy c_o_r_e_ system tables to wheels_. Public API for the wheels migrate rename-system-tables CLI command. Reads the current schema, generates per-adapter rename SQL, and (unless dryRun is true) executes it inside a transaction. After a successful rename, updates application.wheels.{levelsTableName, migratorTableName} to the new names so the running app picks them up without a restart. Result struct:

  • success: boolean
  • renamed: array of “old -> new” strings (empty if no-op)
  • skipped: human message when there’s nothing to do
  • errors: array of error messages (when success=false)
  • sql: array of SQL statements that would run / did run Refuses to run (returns success=false) when both c_o_r_e_ AND wheels_ versions of either table coexist — that’s a partial- rename state which warrants manual cleanup, not silent destruction.
NameTypeRequiredDefaultDescription
dryRunbooleannofalseWhen true, returns the SQL that would run without executing.