{"record":{"id":"56735a11162f56cb","repo":"clockworklabs/SpacetimeDB","slug":"manual-database-migrations-are-not-yet-implemented","errorCode":null,"errorMessage":"Manual database migrations are not yet implemented","messagePattern":"Manual database migrations are not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/engine/src/update.rs","lineNumber":191,"sourceCode":"            .ok_or_else(|| anyhow::anyhow!(\"table {} not found in old_module_def\", table.table_name))?;\n\n        table.check_compatible(owning_def, old_def)?;\n    }\n\n    match plan {\n        MigratePlan::Manual(plan) => manual_migrate_database(stdb, tx, plan, logger),\n        MigratePlan::Auto(plan) => auto_migrate_database(stdb, tx, auth_ctx, plan, logger),\n    }\n}\n\n/// Manually migrate a database.\nfn manual_migrate_database(\n    _stdb: &RelationalDB,\n    _tx: &mut MutTxId,\n    _plan: ManualMigratePlan,\n    _logger: &dyn UpdateLogger,\n) -> anyhow::Result<UpdateResult> {\n    unimplemented!(\"Manual database migrations are not yet implemented\")\n}\n\n/// Logs with `info` level to `$logger` as well as via the `log` crate.\nmacro_rules! log {\n    ($logger:expr, $($tokens:tt)*) => {\n        $logger.info(&format!($($tokens)*));\n        log::info!($($tokens)*);\n    };\n}\n\n/// Automatically migrate a database.\nfn auto_migrate_database(\n    stdb: &RelationalDB,\n    tx: &mut MutTxId,\n    auth_ctx: AuthCtx,\n    plan: AutoMigratePlan,\n    logger: &dyn UpdateLogger,\n) -> anyhow::Result<UpdateResult> {","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/engine/src/update.rs#L173-L209","documentation":"During publish, the engine classifies the schema diff into an auto or manual migration plan. The manual branch, manual_migrate_database (crates/engine/src/update.rs:191), is still unimplemented!(), so any plan that is not auto-migratable panics with this message instead of applying.","triggerScenarios":"Publishing a module update whose diff cannot be auto-migrated (e.g. an in-place column type change with no coercion) and landing on MigratePlan::Manual; explicitly requesting a manual migration flow.","commonSituations":"Changing a column's type in place, deleting/renaming columns in ways auto-migration rejects, or following older docs/roadmap material that describes manual migrations that are not shipped yet.","solutions":["Restructure into auto-migratable steps: add a new column/table, backfill with a reducer, then remove the old one in a later publish","For throwaway/dev databases, publish with --wipe-data (or delete and republish the database) to skip migration entirely","Read the auto-migration report emitted before the failure to identify exactly which change forced the manual plan, and revert that change","Track SpacetimeDB release notes — manual migrations remain on the roadmap"],"exampleFix":"// before (single publish, type change -> manual plan -> panic)\n#[col] pub count: String -> #[col] pub count: u64\n\n// after (two publishes, both auto-migratable)\n// 1) add #[col] count_v2: u64, backfill via reducer\n// 2) remove old count column","handlingStrategy":"fallback","validationCode":"# Before publishing a risky diff, preview the plan:\nspacetime migrate diff  # or the plan/report subcommand your CLI version offers\n# If the report lists non-auto-migratable changes, restructure BEFORE publish","typeGuard":null,"tryCatchPattern":"# In deploy scripts:\nif ! spacetime publish my-module; then\n  # inspect output; if it reports a manual-migration panic, fall back to\n  # the additive two-step publish or (dev only) --wipe-data\n  spacetime publish --wipe-data my-module  # DEV DATABASES ONLY\nfi","preventionTips":["Make schema changes additive (add column/table, backfill, later remove)","Never change a column type in place; migrate via a new column","Preview migration plans in CI against a copy of production schema"],"tags":["migration","database","publish","unimplemented","spacetimedb"],"backgroundTag":"database-migration-unsupported","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}