pub async fn execute_migration_plan(
migration_pool: &Pool,
config_pool: &Pool,
plan: &MigrationPlan,
migration_plan_id: &str,
package_id: &str,
tenant_id: &str,
from_version: Option<&str>,
to_version: &str,
dialect: &dyn Dialect,
) -> Result<MigrationExecutionResult, AppError>Expand description
Execute a pre-computed MigrationPlan against the tenant database.
The plan is reconciled against the database’s actual state first (see reconcile_step), so
steps whose effect is already present are skipped instead of failing the whole migration.
Writes per-step audit records to the config (architect) database.
Returns counts and any warning messages collected from best-effort failures.