From b1b60bb7fe64f6b1ee6c1758f2792a68822bcc8a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 26 Aug 2025 10:54:39 -0700 Subject: [PATCH] Work around duplicate ssh projects in workspace migration (#36946) Fixes another case where the sqlite migration could fail, reported by @SomeoneToIgnore. Release Notes: - N/A --- crates/workspace/src/persistence.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/workspace/src/persistence.rs b/crates/workspace/src/persistence.rs index 12e719cfd9..c4ba93bcec 100644 --- a/crates/workspace/src/persistence.rs +++ b/crates/workspace/src/persistence.rs @@ -599,6 +599,13 @@ impl Domain for WorkspaceDb { ssh_projects ON workspaces.ssh_project_id = ssh_projects.id; + DELETE FROM workspaces_2 + WHERE workspace_id NOT IN ( + SELECT MAX(workspace_id) + FROM workspaces_2 + GROUP BY ssh_connection_id, paths + ); + DROP TABLE ssh_projects; DROP TABLE workspaces; ALTER TABLE workspaces_2 RENAME TO workspaces;