"""Phase 8 validation hardening — indexes already in models; revision for upgrade path."""
from alembic import op
from app.core.database import Base
import app.models  # noqa: F401

revision = "0002_validation_hardening"
down_revision = "0001_initial"
branch_labels = None
depends_on = None


def upgrade():
    # create_all is idempotent for new tables/indexes in greenfield;
    # for existing DBs this ensures metadata indexes from foundation models exist.
    bind = op.get_bind()
    Base.metadata.create_all(bind=bind)


def downgrade():
    # Non-destructive: keep data; indexes remain (safe for shared validation revision).
    pass
