mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
985f650a62
Add managed_by field to Project model to distinguish between: - CONFIG: Projects managed by config file (can be auto-deleted) - USER: Projects created via API/MCP (never auto-deleted) This fixes issue #413 where user-created projects were being deleted during system startup because they weren't in the config file. The fix preserves the behavior from issue #193 (cleaning up orphaned config projects) while protecting user-created projects. Changes: - Add ProjectManagementType enum and managed_by field to Project model - Add database migration for managed_by column (defaults to 'config') - Update add_project() to set managed_by=USER for API-created projects - Update synchronize_projects() to only delete CONFIG-managed projects - Add regression test to ensure USER projects are never auto-deleted - Update existing test to validate CONFIG projects are still cleaned up Closes #413 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Paul Hernandez <phernandez@users.noreply.github.com>