Skip to content

fix: force-rename legacy erd-studio/ data dir to .erd-studio on activation#48

Merged
liam-machine merged 1 commit into
mainfrom
fix/legacy-dir-auto-migration
Jun 10, 2026
Merged

fix: force-rename legacy erd-studio/ data dir to .erd-studio on activation#48
liam-machine merged 1 commit into
mainfrom
fix/legacy-dir-auto-migration

Conversation

@liam-machine

Copy link
Copy Markdown
Owner

Summary

Follow-up to #47. That PR changed the default data directory to .erd-studio/ but gave existing users no migration path — after updating, their domain tree went empty and logical-model resolution broke until they manually renamed the folder or pinned dbtSemantic.semanticDir.

This adds a forced, automatic in-place rename at activation: if the workspace has a legacy erd-studio/ folder, no .erd-studio/, and the default semanticDir, the extension renames the folder before any service reads from disk, then shows an info toast asking the user to commit the rename.

Forced rather than prompted so collaborating teams converge on one layout: the first person to open the repo renames and commits; everyone else pulls the rename before their extension ever sees a legacy folder.

Guards

  • Skips when dbtSemantic.semanticDir is customised (user manages their own location)
  • Skips when .erd-studio/ already exists (e.g. stale branch with both)
  • Skips unless the folder is demonstrably an ERD data dir (layers.json, logical-models/, templates/, or a layer subdir containing .json files) — protects unrelated folders that happen to be named erd-studio

Test plan

  • 13 new unit tests covering detection markers, all skip-guards, rename behaviour, and content preservation
  • npm run compile, npm run build, full suite 377/377 passing

🤖 Generated with Claude Code

…ation

v0.6.44 changed the default data directory to .erd-studio/ but left
existing projects with an erd-studio/ folder looking empty (tree, model
resolution, watchers all read the new default). Rename the folder in
place at activation, before any service reads from disk, so existing
projects keep working with no user action.

Forced (not prompted) so collaborating teams converge: the first person
to open the repo renames and commits; everyone else pulls the rename.
Guards: skips when semanticDir is customised, when .erd-studio already
exists, or when the folder doesn't look like an ERD data dir.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@liam-machine liam-machine merged commit bfad56a into main Jun 10, 2026
2 checks passed
@liam-machine liam-machine deleted the fix/legacy-dir-auto-migration branch June 10, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant