Improved SQL statements #219

This commit is contained in:
Sven Heidemann 2023-02-21 20:51:28 +01:00
parent 6585576266
commit d42b76ba87
3 changed files with 7 additions and 7 deletions

View File

@ -118,8 +118,8 @@ class UserJoinedGameServer(TableABC):
return str( return str(
f""" f"""
UPDATE `UserJoinedGameServer` UPDATE `UserJoinedGameServer`
{"" if self._leaved_on is None else f"SET `LeavedOn` = '{self._leaved_on}',"} {"SET " if self._leaved_on is None else f"`LeavedOn` = '{self._leaved_on}',"}
{"SET " if self._leaved_on is None else ""}`LastModifiedAt` = '{self._modified_at}' `LastModifiedAt` = '{self._modified_at}'
WHERE `Id` = {self._id}; WHERE `Id` = {self._id};
""" """
) )

View File

@ -116,8 +116,8 @@ class UserJoinedServer(TableABC):
return str( return str(
f""" f"""
UPDATE `UserJoinedServers` UPDATE `UserJoinedServers`
{"" if self._leaved_on is None else f"SET `LeavedOn` = '{self._leaved_on}',"} {"SET " if self._leaved_on is None else f"`LeavedOn` = '{self._leaved_on}',"}
{"SET " if self._leaved_on is None else ""}`LastModifiedAt` = '{self._modified_at}' `LastModifiedAt` = '{self._modified_at}'
WHERE `UserId` = {self._user.id}; WHERE `UserId` = {self._user.id};
""" """
) )

View File

@ -125,8 +125,8 @@ class UserJoinedVoiceChannel(TableABC):
return str( return str(
f""" f"""
UPDATE `UserJoinedVoiceChannel` UPDATE `UserJoinedVoiceChannel`
{"" if self._leaved_on is None else f"SET `LeavedOn` = '{self._leaved_on}',"} {"SET " if self._leaved_on is None else f"`LeavedOn` = '{self._leaved_on}',"}
{"SET " if self._leaved_on is None else ""}`LastModifiedAt` = '{self._modified_at}' `LastModifiedAt` = '{self._modified_at}'
WHERE `JoinId` = {self._join_id}; WHERE `JoinId` = {self._join_id};
""" """
) )