"""customers 002 - drop order stats columns (moved to orders module)

Revision ID: customers_002
Revises: customers_001
Create Date: 2026-03-07
"""
import sqlalchemy as sa

from alembic import op

revision = "customers_002"
down_revision = "customers_001"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.drop_column("customers", "total_orders")
    op.drop_column("customers", "total_spent")
    op.drop_column("customers", "last_order_date")


def downgrade() -> None:
    op.add_column(
        "customers",
        sa.Column("last_order_date", sa.DateTime(), nullable=True),
    )
    op.add_column(
        "customers",
        sa.Column("total_spent", sa.Numeric(10, 2), nullable=True, server_default="0"),
    )
    op.add_column(
        "customers",
        sa.Column("total_orders", sa.Integer(), nullable=True, server_default="0"),
    )
