feat: safe connection deletion and unlinked project management#76
Merged
Conversation
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.
PR Description
Background / Problem
Previously, when a user deleted a database connection, any linked project data (like schemas, local queries, diagrams, and migrations) was at risk of being silently orphaned or permanently lost without proper warning. There was also no way in the UI to manage projects that had lost their connection or to easily re-attach them.
What changed?
This PR overhauls the project lifecycle and database deletion flow to ensure zero accidental data loss, while introducing a robust system to manage orphaned projects.
Key Features:
DeleteConnectionDialogexplicitly asks the user if they want to Unlink the project (keeping the data safe) or Delete everything.ConnectionListsidebar, flagged with a clear warning badge.Minor Fixes:
MigrationStatusCardwhere the "Pending Migrations" count could display as a negative number during unexpected states (now correctly clamped to zero).radio-groupdependency.FEATURES.mddocumentation to reflect these new capabilities (and recent SSH tunneling support).Technical Implementation Details:
useDeleteConnectionhook to orchestrate the multi-step deletion flow and React Query invalidations.UnlinkedProjectItemandDeleteConnectionDialog.project.relinkToConnection,project.unlinkFromConnection, andproject.getGitRemote.How to test: