"""Remove Issue.github_timeline_etag and github_timeline_fetched_at

Revision ID: 314683b1504d
Revises: b608f7a7a743
Create Date: 2024-10-10 13:05:37.544507

"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "314683b1504d"
down_revision = "b608f7a7a743"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("issues", "github_timeline_etag")
    op.drop_column("issues", "github_timeline_fetched_at")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "issues",
        sa.Column(
            "github_timeline_fetched_at",
            postgresql.TIMESTAMP(timezone=True),
            autoincrement=False,
            nullable=True,
        ),
    )
    op.add_column(
        "issues",
        sa.Column(
            "github_timeline_etag", sa.VARCHAR(), autoincrement=False, nullable=True
        ),
    )
    # ### end Alembic commands ###
