Skip to content

Commit 2bdbdf9

Browse files
maxbrunsfeldFrGoIs
authored andcommitted
Work around duplicate ssh projects in workspace migration (zed-industries#36946)
Fixes another case where the sqlite migration could fail, reported by @SomeoneToIgnore. Release Notes: - N/A
1 parent 570cb05 commit 2bdbdf9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/workspace/src/persistence.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,13 @@ impl Domain for WorkspaceDb {
599599
ssh_projects ON
600600
workspaces.ssh_project_id = ssh_projects.id;
601601

602+
DELETE FROM workspaces_2
603+
WHERE workspace_id NOT IN (
604+
SELECT MAX(workspace_id)
605+
FROM workspaces_2
606+
GROUP BY ssh_connection_id, paths
607+
);
608+
602609
DROP TABLE ssh_projects;
603610
DROP TABLE workspaces;
604611
ALTER TABLE workspaces_2 RENAME TO workspaces;

0 commit comments

Comments
 (0)