Fixed achievement query #268_achievements
This commit is contained in:
@@ -20,11 +20,11 @@ class AchievementsMigration(MigrationABC):
|
||||
f"""
|
||||
CREATE TABLE IF NOT EXISTS `Achievements` (
|
||||
`Id` BIGINT NOT NULL AUTO_INCREMENT,
|
||||
`ServerId` BIGINT,
|
||||
`Name` VARCHAR(255) NOT NULL,
|
||||
`Attribute` VARCHAR(255) NOT NULL,
|
||||
`Operator` VARCHAR(2) NOT NULL,
|
||||
`Value` VARCHAR(255) NOT NULL,
|
||||
`ServerId` BIGINT,
|
||||
`CreatedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6),
|
||||
`LastModifiedAt` DATETIME(6) NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
|
||||
PRIMARY KEY(`Id`),
|
||||
|
@@ -41,6 +41,14 @@ class Achievement(TableABC):
|
||||
def name(self, value: str):
|
||||
self._name = value
|
||||
|
||||
@property
|
||||
def attribute(self) -> str:
|
||||
return self._attribute
|
||||
|
||||
@attribute.setter
|
||||
def attribute(self, value: str):
|
||||
self._attribute = value
|
||||
|
||||
@property
|
||||
def operator(self) -> str:
|
||||
return self._operator
|
||||
|
@@ -23,11 +23,11 @@ class AchievementRepositoryService(AchievementRepositoryABC):
|
||||
|
||||
def _from_result(self, result: tuple):
|
||||
return Achievement(
|
||||
result[1],
|
||||
result[2],
|
||||
result[3],
|
||||
result[4],
|
||||
result[5],
|
||||
result[6],
|
||||
self._servers.get_server_by_id(result[2]),
|
||||
self._servers.get_server_by_id(result[5]),
|
||||
result[6],
|
||||
result[7],
|
||||
id=result[0],
|
||||
|
Reference in New Issue
Block a user