{"record":{"id":"d222b02b48c1a947","repo":"clockworklabs/SpacetimeDB","slug":"aborting-because-publishing-would-require-manual-m","errorCode":null,"errorMessage":"Aborting because publishing would require manual migration or deletion of data and --delete-data was not specified.","messagePattern":"Aborting because publishing would require manual migration or deletion of data and --delete-data was not specified\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":795,"sourceCode":"        program_bytes,\n        auth_header,\n    )\n    .await?\n    {\n        let major_version_upgrade = match &pre {\n            PrePublishResult::AutoMigrate(auto) => auto.major_version_upgrade,\n            PrePublishResult::ManualMigrate(manual) => manual.major_version_upgrade,\n        };\n        if major_version_upgrade {\n            confirm_major_version_upgrade(yes.migrate_major_version)?;\n        }\n\n        match pre {\n            PrePublishResult::ManualMigrate(manual) => {\n                if clear_database == ClearMode::Never {\n                    println!(\"{}\", manual.reason);\n                    println!(\"Aborting publish due to required manual migration.\");\n                    anyhow::bail!(\"Aborting because publishing would require manual migration or deletion of data and --delete-data was not specified.\");\n                }\n                println!(\"{}\", manual.reason);\n                println!(\"Proceeding with database clear due to --delete-data=on-conflict.\");\n\n                builder = confirm_and_clear(name_or_identity, yes.delete_data, builder)?;\n            }\n            PrePublishResult::AutoMigrate(auto) => {\n                println!(\"{}\", auto.migrate_plan);\n                // We only arrive here if you have not specified ClearMode::Always AND there was no\n                // conflict that required manual migration.\n                if auto.break_clients\n                    && !y_or_n(\n                        force_break_clients || yes.break_clients,\n                        \"The above changes will BREAK existing clients. Do you want to proceed?\",\n                    )?\n                {\n                    println!(\"Aborting\");\n                    // Early exit: return an error or a special signal. Here we bail out by returning Err.","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/publish.rs#L777-L813","documentation":"The pre-publish check (`call_pre_publish`) returned `PrePublishResult::ManualMigrate`, meaning the new module schema cannot be auto-migrated from the existing one. The CLI prints the server's `manual.reason`, then — because `clear_database` is `ClearMode::Never` (no `--delete-data`) — it refuses to continue: proceeding would require manual migration or wiping the database's data.","triggerScenarios":"Publishing schema changes the server deems non-auto-migratable (dropped/retyped tables, incompatible row changes) to an existing database without passing `--delete-data`; also after a major version upgrade prompt was confirmed but the plan still needs manual work.","commonSituations":"Iterating on a module during development and making incompatible table edits against a local database you no longer care about; publishing an intentional breaking schema change to a database with live data; upgrading the module SDK across a major version boundary.","solutions":["Re-run with `--delete-data` (maps to ClearMode::OnConflict) if the data is disposable: the CLI will confirm and clear the database before publishing","If the data matters, follow the printed `manual.reason` and perform the migration manually, or revert the schema change so auto-migration applies","Back up / export needed rows before clearing, since clearing deletes all database data","For development loops, keep a seed script so `--delete-data` re-publishes are cheap"],"exampleFix":"# before\nspacetime publish mydb   # requires manual migration -> aborted\n# after\nspacetime publish mydb --delete-data","handlingStrategy":"validation","validationCode":"# In throwaway dev databases, make data loss explicit up front\nspacetime publish mydb --delete-data   # instead of plain publish","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a seed/reseed script so `--delete-data` republishes are cheap in dev","For valuable data, export before publishing schema changes","Avoid retyping/dropping columns when an additive change achieves the same migration-safe result"],"tags":["spacetimedb","publish","schema-migration","breaking-change","cli"],"backgroundTag":"breaking-schema-migration","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}