"""empty message

Revision ID: e38002759d8f
Revises: 87da368d282b
Create Date: 2025-05-16 18:27:19.683673

"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e38002759d8f'
down_revision = '87da368d282b'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('abuser_audit_log',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
    sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('admin_id', sa.Integer(), nullable=True),
    sa.Column('action', sa.String(length=255), nullable=False),
    sa.Column('message', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_abuser_audit_log_user_id'), 'abuser_audit_log', ['user_id'], unique=False)
    op.create_table('abuser_data',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
    sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('encrypted_bundle', sa.LargeBinary(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_abuser_data_id', 'abuser_data', ['id'], unique=False)
    op.create_index(op.f('ix_abuser_data_user_id'), 'abuser_data', ['user_id'], unique=False)
    op.create_table('abuser_lookup',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
    sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
    sa.Column('hashed_address', sa.String(length=64), nullable=False),
    sa.Column('abuser_data_id', sa.Integer(), nullable=False),
    sa.Column('bundle_k', sa.LargeBinary(), nullable=False),
    sa.ForeignKeyConstraint(['abuser_data_id'], ['abuser_data.id'], ondelete='cascade'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_abuser_lookup_abuser_data_id'), 'abuser_lookup', ['abuser_data_id'], unique=False)
    op.create_index(op.f('ix_abuser_lookup_hashed_address'), 'abuser_lookup', ['hashed_address'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_abuser_lookup_hashed_address'), table_name='abuser_lookup')
    op.drop_index(op.f('ix_abuser_lookup_abuser_data_id'), table_name='abuser_lookup')
    op.drop_table('abuser_lookup')
    op.drop_index(op.f('ix_abuser_data_user_id'), table_name='abuser_data')
    op.drop_index('ix_abuser_data_id', table_name='abuser_data')
    op.drop_table('abuser_data')
    op.drop_index(op.f('ix_abuser_audit_log_user_id'), table_name='abuser_audit_log')
    op.drop_table('abuser_audit_log')
    # ### end Alembic commands ###
