"""Phase 5: Extended label horizons (10D, 20D forward returns and MFE/MAE).

Revision ID: 0003
Revises: 0002
Create Date: 2026-03-13

Adds columns:
- fwd_return_10d, fwd_return_20d
- mfe_10d, mae_10d, mfe_20d, mae_20d
"""
from __future__ import annotations

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

revision: str = "0003"
down_revision: str | None = "0002"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
    op.add_column("event_labels", sa.Column("fwd_return_10d", sa.Numeric, nullable=True))
    op.add_column("event_labels", sa.Column("fwd_return_20d", sa.Numeric, nullable=True))
    op.add_column("event_labels", sa.Column("mfe_10d", sa.Numeric, nullable=True))
    op.add_column("event_labels", sa.Column("mae_10d", sa.Numeric, nullable=True))
    op.add_column("event_labels", sa.Column("mfe_20d", sa.Numeric, nullable=True))
    op.add_column("event_labels", sa.Column("mae_20d", sa.Numeric, nullable=True))


def downgrade() -> None:
    op.drop_column("event_labels", "mae_20d")
    op.drop_column("event_labels", "mfe_20d")
    op.drop_column("event_labels", "mae_10d")
    op.drop_column("event_labels", "mfe_10d")
    op.drop_column("event_labels", "fwd_return_20d")
    op.drop_column("event_labels", "fwd_return_10d")
