Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Work around duplicate ssh projects in workspace migration (#36946)

Max Brunsfeldb1b60bb7fe64
diff --git a/crates/workspace/src/persistence.rs b/crates/workspace/src/persistence.rs
index 12e719cfd91..c4ba93bcec6 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;