Fixed add user
This commit is contained in:
parent
c2fa1a1c00
commit
940a2ed065
@ -176,7 +176,7 @@ class DataIntegrityService:
|
||||
|
||||
self._logger.warn(__name__, f"User not found in database: {u.id}")
|
||||
self._logger.debug(__name__, f"Add user: {u.id}")
|
||||
self._users.add_user(User(u.id, 0, 0, 0, server))
|
||||
self._users.add_user(User(u.id, 0, 0, 0, None, server))
|
||||
self._db_context.save_changes()
|
||||
|
||||
self._logger.debug(__name__, f"Added User: {u.id}")
|
||||
|
@ -191,7 +191,7 @@ class User(TableABC):
|
||||
{self._xp},
|
||||
{self._message_count},
|
||||
{self._reaction_count},
|
||||
'{self._birthday}',
|
||||
{"NULL" if self._birthday is None else f"'{self._birthday}'"},
|
||||
{self._server.id}
|
||||
);
|
||||
"""
|
||||
@ -205,7 +205,7 @@ class User(TableABC):
|
||||
SET `XP` = {self._xp},
|
||||
`MessageCount` = {self._message_count},
|
||||
`ReactionCount` = {self._reaction_count},
|
||||
`Birthday` = '{self._birthday}'
|
||||
`Birthday` = {"NULL" if self._birthday is None else f"'{self._birthday}'"}
|
||||
WHERE `UserId` = {self._user_id};
|
||||
"""
|
||||
)
|
||||
|
@ -21,7 +21,7 @@ class MigrationService:
|
||||
self._cursor = db.cursor
|
||||
|
||||
self._migrations: List[MigrationABC] = (
|
||||
List(type, MigrationABC.__subclasses__()).order_by(lambda x: x.name).order_by(lambda x: x.prio)
|
||||
List(type, MigrationABC.__subclasses__()).order_by(lambda x: x.name.split("_")[0]).then_by(lambda x: x.prio)
|
||||
)
|
||||
|
||||
def migrate(self):
|
||||
|
Loading…
Reference in New Issue
Block a user