Closed FabioPatella closed 1 year ago
"It's not a bug, it's a feature". Jokes aside, this behavior is intentional. Deleting the team from the database violates some foreign keys constraints. For example old tournaments in which the team participated will have references to the team, which are actually also visible in the user interface (for example you can still see the winner of an old tournament even if the winning team has been deleted).
If the problem is that the name of a deleted team can't be used anymore, this can actually be solved by checking that team names are unique only for valid teams. But allowing reusing names of deleted teams has still some problems. For example you can take the name of a deleted team which won some past tournaments and from the user interface it will seem as if your team has won those tournaments.
it makes sense ( we can just say that it is not possible to use a name of a inactive team for the reason you have listed)
when the ledear successfully exit from the team , the team is not deleted ( and in the db is still present with -1 number of players if the leader was alone in the team when he has left).