"""remove scan_id of logs

Revision ID: faceebd6a580
Revises: fa0ab51b2f64
Create Date: 2025-06-07 20:03:48.966194

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'faceebd6a580'
down_revision: Union[str, None] = 'fa0ab51b2f64'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('logs_scan_id_fkey', 'logs', type_='foreignkey')
    op.drop_column('logs', 'scan_id')
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('logs', sa.Column('scan_id', sa.UUID(), autoincrement=False, nullable=True))
    op.create_foreign_key('logs_scan_id_fkey', 'logs', 'scans', ['scan_id'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###
