"""add length in varchar

迁移 ID: 2e39fdc3f6b1
父迁移: 263d60026863
创建时间: 2024-08-03 11:29:05.345859

"""

from __future__ import annotations

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

revision: str = "2e39fdc3f6b1"
down_revision: str | Sequence[str] | None = "263d60026863"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade(name: str = "") -> None:
    if name:
        return
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("wakatime", schema=None) as batch_op:
        batch_op.alter_column(
            "access_token",
            existing_type=sa.VARCHAR(),
            type_=sa.Text(),
            existing_nullable=False,
        )

    # ### end Alembic commands ###


def downgrade(name: str = "") -> None:
    if name:
        return
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("wakatime", schema=None) as batch_op:
        batch_op.alter_column(
            "access_token",
            existing_type=sa.Text(),
            type_=sa.VARCHAR(),
            existing_nullable=False,
        )

    # ### end Alembic commands ###
