{"record":{"id":"7ce9c8d59b4329fc","repo":"clockworklabs/SpacetimeDB","slug":"manual-migration-plans-are-not-yet-supported-for-p","errorCode":null,"errorMessage":"Manual migration plans are not yet supported for pretty printing.","messagePattern":"Manual migration plans are not yet supported for pretty printing\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/schema/src/auto_migrate.rs","lineNumber":75,"sourceCode":"        }\n    }\n\n    pub fn breaks_client(&self) -> bool {\n        match self {\n            //TODO: fix it when support for manual migration plans is added.\n            MigratePlan::Manual(_) => true,\n            MigratePlan::Auto(plan) => plan\n                .steps\n                .iter()\n                .any(|step| matches!(step, AutoMigrateStep::DisconnectAllUsers)),\n        }\n    }\n\n    pub fn pretty_print(&self, style: PrettyPrintStyle) -> anyhow::Result<String> {\n        use PrettyPrintStyle::*;\n        match self {\n            MigratePlan::Manual(_) => {\n                anyhow::bail!(\"Manual migration plans are not yet supported for pretty printing.\")\n            }\n\n            MigratePlan::Auto(plan) => match style {\n                NoColor => {\n                    let mut fmt = TermColorFormatter::new(ColorScheme::default(), termcolor::ColorChoice::Never);\n                    format_plan(&mut fmt, plan).map(|_| fmt.to_string())\n                }\n                AnsiColor => {\n                    let mut fmt = TermColorFormatter::new(ColorScheme::default(), termcolor::ColorChoice::AlwaysAnsi);\n                    format_plan(&mut fmt, plan).map(|_| fmt.to_string())\n                }\n            }\n            .map_err(|e| anyhow::anyhow!(\"Failed to format migration plan: {e}\")),\n        }\n    }\n}\n\n/// A migration policy that determines whether a module update is allowed to break client compatibility.","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/schema/src/auto_migrate.rs#L57-L93","documentation":"When schema changes cannot be handled automatically, SpacetimeDB can produce a Manual migration plan (generated Rust migration code). MigratePlan::pretty_print only implements the Auto variant; asking it to render a Manual plan bails with this message.","triggerScenarios":"Requesting a human-readable dump of a migration plan that turned out to be MigratePlan::Manual, i.e. the schema diff contained changes the auto-migrator cannot express as auto steps.","commonSituations":"Inspecting a plan for a publish that includes incompatible changes (e.g. column type rewrites requiring data migration); running plan-preview tooling on a large schema refactor.","solutions":["Use the non-pretty output path: write the manual migration module to a file instead of printing it to the terminal.","Refactor the schema change into additive, auto-migratable steps (add new columns/tables instead of rewriting) so the plan stays Auto and pretty printing works."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"# detect a manual plan before asking for pretty output:\n# if the tooling reports the plan is Manual, route to file output instead of\n# the pretty-print/preview path; only Auto plans support pretty printing","typeGuard":null,"tryCatchPattern":"match plan.pretty_print(style) {\n    Err(e) if e.to_string().contains(\"Manual migration plans\") => {\n        // write the generated manual migration module to a file instead\n    }\n    other => other,\n}","preventionTips":["Prefer additive schema changes so plans stay Auto and previewable.","Expect manual-migration output as files, not terminal rendering.","Preview plans early in schema refactors to learn which shape you are in."],"tags":["migration","manual-migration","pretty-print","cli"],"backgroundTag":"unsupported-migration-step","analyzedSha":"6dee26c6efc2856793e12b148a59742964f5d783","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}