feat(bot): ✨ Make prefixes allow up to 5 characters.

This commit is contained in:
Nyeki.py
2024-10-17 02:10:18 -03:00
parent 130cadd6df
commit aaae63c420
3 changed files with 15 additions and 4 deletions
@@ -0,0 +1,11 @@
from tortoise import BaseDBAsyncClient
async def upgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "server" ALTER COLUMN "prefix" TYPE VARCHAR(5) USING "prefix"::VARCHAR(5);"""
async def downgrade(db: BaseDBAsyncClient) -> str:
return """
ALTER TABLE "server" ALTER COLUMN "prefix" TYPE VARCHAR(3) USING "prefix"::VARCHAR(3);"""
+1 -1
View File
@@ -73,7 +73,7 @@ class Profile(models.Model):
class Server(models.Model):
id: int = fields.BigIntField(primary_key=True)
prefix: str = fields.CharField(max_length=3, default="p.")
prefix: str = fields.CharField(max_length=5, default="p.")
channels: fields.BackwardFKRelation["Channel"]
profiles: fields.BackwardFKRelation["Profile"]