feat(bot): ✨ Add server's vanity invite in leaderboard.

This commit is contained in:
Nyeki.py
2024-10-19 00:45:53 -03:00
parent 4e040ca8ad
commit b06db39074
4 changed files with 31 additions and 6 deletions
@@ -0,0 +1,11 @@
from tortoise import BaseDBAsyncClient
async def upgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "server" ADD "vanity_code" VARCHAR(32);"""
async def downgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "server" DROP COLUMN "vanity_code";"""
+1
View File
@@ -93,6 +93,7 @@ class Server(models.Model):
prefix: str = fields.CharField(max_length=5, default="p.")
leaderboard_position: int = fields.IntField(default=0, db_index=True)
leaderboard_calls_count: int = fields.IntField(default=0)
vanity_code: str = fields.CharField(max_length=32, null=True, default=None)
channels: fields.BackwardFKRelation["Channel"]
profiles: fields.BackwardFKRelation["Profile"]