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
This commit is contained in:
Max Brunsfeld 2025-08-26 10:54:39 -07:00 committed by GitHub
parent 0e575b2809
commit b1b60bb7fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;