"""add_intel_items_table

Revision ID: ef21f4a670ed
Revises: 7cec59461d53
Create Date: 2026-02-06 11:10:30.452222

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


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


def upgrade() -> None:
    """Upgrade schema."""
    op.create_table('intel_items',
    sa.Column('id', sa.UUID(), nullable=False),
    sa.Column('technique_id', sa.UUID(), nullable=True),
    sa.Column('url', sa.String(), nullable=False),
    sa.Column('title', sa.String(), nullable=True),
    sa.Column('source', sa.String(), nullable=True),
    sa.Column('detected_at', sa.DateTime(), nullable=True),
    sa.Column('reviewed', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['technique_id'], ['techniques.id'], ),
    sa.PrimaryKeyConstraint('id')
    )


def downgrade() -> None:
    """Downgrade schema."""
    op.drop_table('intel_items')
