Skip to content

Commit

Permalink
Merge pull request #347 from MerginMaps/fix_alembic_deleted_projects
Browse files Browse the repository at this point in the history
Fix db migration not to include deleted projects
  • Loading branch information
MarcelGeo authored Dec 16, 2024
2 parents b4cef2a + 6275d97 commit 141baa2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ def data_upgrade():
SELECT m.workspace_id, m.user_id, m.role::workspace_role
FROM members m
LEFT OUTER JOIN "user" u on u.id = m.user_id
WHERE u.username !~ 'deleted_\d{13}$';
LEFT OUTER JOIN project p ON p.id = m.project_id
WHERE
u.username !~ 'deleted_\d{13}$' AND
p.removed_at IS NULL;
"""
)
)
Expand Down

0 comments on commit 141baa2

Please sign in to comment.