"""Add Customer.meters_dirtied_at/meters_updated_at

Revision ID: 6b14ecb99cf9
Revises: 4ca9ae9d2dba
Create Date: 2025-10-03 14:32:55.743998

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

# revision identifiers, used by Alembic.
revision = "6b14ecb99cf9"
down_revision = "4ca9ae9d2dba"
branch_labels: tuple[str] | None = None
depends_on: tuple[str] | None = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "customers",
        sa.Column("meters_dirtied_at", sa.TIMESTAMP(timezone=True), nullable=True),
    )
    op.add_column(
        "customers",
        sa.Column("meters_updated_at", sa.TIMESTAMP(timezone=True), nullable=True),
    )
    op.create_index(
        op.f("ix_customers_meters_dirtied_at"),
        "customers",
        ["meters_dirtied_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_customers_meters_updated_at"),
        "customers",
        ["meters_updated_at"],
        unique=False,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_customers_meters_updated_at"), table_name="customers")
    op.drop_index(op.f("ix_customers_meters_dirtied_at"), table_name="customers")
    op.drop_column("customers", "meters_updated_at")
    op.drop_column("customers", "meters_dirtied_at")
    # ### end Alembic commands ###
