"""


Revision ID: 1ef9c4f3765d
Revises: fd531f8868b1
Create Date: 2023-12-04 15:00:27.968998

"""

from typing import Sequence, Union

import sqlalchemy as sa
import sqlmodel
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "1ef9c4f3765d"
down_revision: Union[str, None] = "fd531f8868b1"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    try:
        with op.batch_alter_table("apikey", schema=None) as batch_op:
            batch_op.alter_column(
                "name", existing_type=sqlmodel.sql.sqltypes.AutoString(), nullable=True
            )
    except Exception as e:
        pass
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    try:
        with op.batch_alter_table("apikey", schema=None) as batch_op:
            batch_op.alter_column("name", existing_type=sa.VARCHAR(), nullable=False)
    except Exception as e:
        pass
    # ### end Alembic commands ###
