feat(bot): ⚰️ Remove appeals support.

This commit is contained in:
Nyeki.py
2024-10-19 21:42:18 -03:00
parent a7a1183a8e
commit d2f3355644
6 changed files with 14 additions and 99 deletions
@@ -0,0 +1,13 @@
from tortoise import BaseDBAsyncClient
async def upgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "ban" DROP COLUMN "appeal";
ALTER TABLE "ban" DROP COLUMN "status";"""
async def downgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "ban" ADD "appeal" VARCHAR(500);
ALTER TABLE "ban" ADD "status" SMALLINT NOT NULL DEFAULT 0;"""
-9
View File
@@ -337,13 +337,6 @@ class Report(models.Model):
created_at: datetime = fields.DatetimeField(auto_now_add=True)
class BanStatus(enum.IntEnum):
VALID = 0
ON_REVIEW = 1
APPEAL_ACCEPTED = 2
APPEAL_DECLINED = 3
class Ban(models.Model):
user_id: int = fields.BigIntField()
report: fields.ForeignKeyNullableRelation["Report"] = fields.ForeignKeyField(
@@ -354,8 +347,6 @@ class Ban(models.Model):
)
notification_message_id: int = fields.BigIntField(null=True, db_index=True)
reason: str = fields.CharField(max_length=500)
appeal: str | None = fields.CharField(max_length=500, null=True)
status: BanStatus = fields.IntEnumField(BanStatus, default=BanStatus.VALID)
banned_by: fields.ForeignKeyRelation["User"] = fields.ForeignKeyField(
"models.User", related_name="bans_created", null=True
)