feat(bot): ✨ Support for banning and warning by username.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
from tortoise import BaseDBAsyncClient
|
||||
|
||||
|
||||
async def upgrade(db: BaseDBAsyncClient) -> str:
|
||||
return """
|
||||
CREATE INDEX "idx_user_usernam_9987ab" ON "user" ("username");"""
|
||||
|
||||
|
||||
async def downgrade(db: BaseDBAsyncClient) -> str:
|
||||
return """
|
||||
DROP INDEX "idx_user_usernam_9987ab";"""
|
||||
@@ -13,7 +13,7 @@ from payphone.core import config, constants
|
||||
|
||||
class User(models.Model):
|
||||
id: int = fields.BigIntField(primary_key=True)
|
||||
username: str = fields.CharField(max_length=32)
|
||||
username: str = fields.CharField(max_length=32, db_index=True)
|
||||
is_masked: bool = fields.BooleanField(default=False)
|
||||
is_moderator: bool = fields.BooleanField(default=False)
|
||||
profiles: fields.BackwardFKRelation["Profile"]
|
||||
@@ -21,9 +21,7 @@ class User(models.Model):
|
||||
leaderboard_position: int | None = fields.IntField(
|
||||
default=None, null=True, db_index=True
|
||||
)
|
||||
leaderboard_calls_count: int | None = fields.IntField(
|
||||
default=None, null=True
|
||||
)
|
||||
leaderboard_calls_count: int | None = fields.IntField(default=None, null=True)
|
||||
joined_at: datetime = fields.DatetimeField(auto_now_add=True)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user