35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
"""channel poll status
|
|
|
|
Revision ID: 0013
|
|
Revises: 0012
|
|
Create Date: 2026-06-17
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0013"
|
|
down_revision: Union[str, None] = "0012"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column("channels", sa.Column("last_poll_status", sa.String(length=32), nullable=True))
|
|
op.add_column("channels", sa.Column("last_poll_error_code", sa.String(length=64), nullable=True))
|
|
op.add_column("channels", sa.Column("last_poll_error", sa.Text(), nullable=True))
|
|
op.add_column("channels", sa.Column("last_poll_error_at", sa.DateTime(timezone=True), nullable=True))
|
|
op.create_index("ix_channels_last_poll_status", "channels", ["last_poll_status"])
|
|
op.create_index("ix_channels_last_poll_error_code", "channels", ["last_poll_error_code"])
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_channels_last_poll_error_code", table_name="channels")
|
|
op.drop_index("ix_channels_last_poll_status", table_name="channels")
|
|
op.drop_column("channels", "last_poll_error_at")
|
|
op.drop_column("channels", "last_poll_error")
|
|
op.drop_column("channels", "last_poll_error_code")
|
|
op.drop_column("channels", "last_poll_status")
|