Toggling TeamDeletion with TeamDeleted bit for database integrity #43
@ -56,13 +56,13 @@ public class Team {
|
||||
for(Team team : teamCache)
|
||||
if(team.teamKuerzel.equalsIgnoreCase(name))
|
||||
return team;
|
||||
return load(select("SELECT * FROM Team WHERE lower(TeamName) = '" + SQL.disarmString(name).toLowerCase() + "' OR lower(TeamKuerzel) = '" + SQL.disarmString(name).toLowerCase() + "'"));
|
||||
return load(select("SELECT * FROM Team WHERE (lower(TeamName) = '" + SQL.disarmString(name).toLowerCase() + "' OR lower(TeamKuerzel) = '" + SQL.disarmString(name).toLowerCase() + "') AND NOT TeamDeleted"));
|
||||
}
|
||||
|
||||
public static List<Team> getAll(){
|
||||
clearCache();
|
||||
try{
|
||||
ResultSet rs = select("SELECT * FROM Team WHERE TeamID > 0");
|
||||
ResultSet rs = select("SELECT * FROM Team WHERE NOT TeamDeleted");
|
||||
if(rs == null)
|
||||
return teamCache;
|
||||
|
||||
@ -141,7 +141,7 @@ public class Team {
|
||||
}
|
||||
|
||||
public void disband(){
|
||||
SQL.update("DELETE FROM Team WHERE TeamID = " + teamId);
|
||||
SQL.update("UPDATE Team SET TeamDeleted = 1, TeamLeader = NULL WHERE TeamID = " + teamId);
|
||||
teamCache.remove(this);
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren