"""Remove User.username

Revision ID: 40fa303ba84e
Revises: ace3b0ceefc3
Create Date: 2024-10-28 16:55:38.596756

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "40fa303ba84e"
down_revision = "ace3b0ceefc3"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("users_username_key", "users", type_="unique")
    op.drop_column("users", "username")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "users",
        sa.Column(
            "username", sa.VARCHAR(length=50), autoincrement=False, nullable=False
        ),
    )
    op.create_unique_constraint("users_username_key", "users", ["username"])
    # ### end Alembic commands ###
