fix: force-rename legacy erd-studio/ data dir to .erd-studio on activation#48
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 pinneddbtSemantic.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 defaultsemanticDir, 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
dbtSemantic.semanticDiris customised (user manages their own location).erd-studio/already exists (e.g. stale branch with both)layers.json,logical-models/,templates/, or a layer subdir containing.jsonfiles) — protects unrelated folders that happen to be namederd-studioTest plan
npm run compile,npm run build, full suite 377/377 passing🤖 Generated with Claude Code