Work around duplicate ssh projects in workspace migration

This commit is contained in:
Max Brunsfeld 2025-08-26 10:11:09 -07:00
parent 65c6c709fd
commit 74d98dcb42

View file

@ -599,6 +599,13 @@ impl Domain for WorkspaceDb {
ssh_projects ON ssh_projects ON
workspaces.ssh_project_id = ssh_projects.id; 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 ssh_projects;
DROP TABLE workspaces; DROP TABLE workspaces;
ALTER TABLE workspaces_2 RENAME TO workspaces; ALTER TABLE workspaces_2 RENAME TO workspaces;