mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2025-12-06 14:45:36 +01:00
Add message_id and chat_id to CachedFile
This commit is contained in:
28
src/app/alembic/versions/f77b0b14f9eb_.py
Normal file
28
src/app/alembic/versions/f77b0b14f9eb_.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: f77b0b14f9eb
|
||||||
|
Revises: 9b7cfb422191
|
||||||
|
Create Date: 2022-12-30 22:53:41.951490
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = "f77b0b14f9eb"
|
||||||
|
down_revision = "9b7cfb422191"
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.add_column(
|
||||||
|
"cached_files", sa.Column("message_id", sa.BigInteger(), nullable=True)
|
||||||
|
)
|
||||||
|
op.add_column("cached_files", sa.Column("chat_id", sa.BigInteger(), nullable=True))
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
op.drop_column("cached_files", "message_id")
|
||||||
|
op.drop_column("cached_files", "chat_id")
|
||||||
@@ -16,4 +16,8 @@ class CachedFile(ormar.Model):
|
|||||||
id: int = ormar.Integer(primary_key=True) # type: ignore
|
id: int = ormar.Integer(primary_key=True) # type: ignore
|
||||||
object_id: int = ormar.Integer(index=True) # type: ignore
|
object_id: int = ormar.Integer(index=True) # type: ignore
|
||||||
object_type: str = ormar.String(max_length=8, index=True) # type: ignore
|
object_type: str = ormar.String(max_length=8, index=True) # type: ignore
|
||||||
|
|
||||||
|
message_id: int = ormar.BigInteger() # type: ignore
|
||||||
|
chat_id: int = ormar.BigInteger() # type: ignore
|
||||||
|
|
||||||
data: dict = ormar.JSON() # type: ignore
|
data: dict = ormar.JSON() # type: ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user