When we delete a team, the relationship is also removed from the membership table, along with any associated applications and actions. This is achieved through foreign constraints.
However, currently, the user is also deleted along with the team. To prevent this from happening, I've adjusted the team_id field, making it nullable, and also updated the constraint.
We're not using the team_id field in the user table; it's kept for backward compatibility with the old frontend. We'll need to remove it entirely.
When we delete a team, the relationship is also removed from the membership table, along with any associated applications and actions. This is achieved through foreign constraints. However, currently, the user is also deleted along with the team. To prevent this from happening, I've adjusted the team_id field, making it nullable, and also updated the constraint. We're not using the team_id field in the user table; it's kept for backward compatibility with the old frontend. We'll need to remove it entirely.