"""rm FailedLoginAttempts

Revision ID: 26bfe19b49d4
Revises: 74288ccbd3b5
Create Date: 2024-11-25 15:40:46.757073

"""
from typing import Sequence, Union

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

# revision identifiers, used by Alembic.
revision: str = '26bfe19b49d4'
down_revision: Union[str, None] = '74288ccbd3b5'
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! ###
    op.drop_table('failedloginattempts')
    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.add_column(sa.Column('attempt_count', sa.Integer(), nullable=True))

    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.drop_column('attempt_count')

    op.create_table('failedloginattempts',
    sa.Column('uuid', sa.UUID(), autoincrement=False, nullable=False),
    sa.Column('shortname', sa.VARCHAR(), autoincrement=False, nullable=False),
    sa.Column('attempt_count', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('timestamp', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('uuid', name='failedloginattempts_pkey')
    )
    # ### end Alembic commands ###
