"""Remove indices on modified_at

Revision ID: 4b889494f84f
Revises: f03f2ade2c86
Create Date: 2025-08-18 17:26:58.646906

"""

import sqlalchemy as sa
from alembic import op

# Polar Custom Imports

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


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_accounts_modified_at"), table_name="accounts")
    op.drop_index(op.f("ix_benefit_grants_modified_at"), table_name="benefit_grants")
    op.drop_index(op.f("ix_benefits_modified_at"), table_name="benefits")
    op.drop_index(op.f("ix_billing_entry_modified_at"), table_name="billing_entry")
    op.drop_index(op.f("ix_campaigns_modified_at"), table_name="campaigns")
    op.drop_index(
        op.f("ix_checkout_link_products_modified_at"),
        table_name="checkout_link_products",
    )
    op.drop_index(op.f("ix_checkout_links_modified_at"), table_name="checkout_links")
    op.drop_index(
        op.f("ix_checkout_products_modified_at"), table_name="checkout_products"
    )
    op.drop_index(op.f("ix_checkouts_modified_at"), table_name="checkouts")
    op.drop_index(op.f("ix_custom_fields_modified_at"), table_name="custom_fields")
    op.drop_index(op.f("ix_customer_meters_modified_at"), table_name="customer_meters")
    op.drop_index(
        op.f("ix_customer_session_codes_modified_at"),
        table_name="customer_session_codes",
    )
    op.drop_index(
        op.f("ix_customer_sessions_modified_at"), table_name="customer_sessions"
    )
    op.drop_index(op.f("ix_customers_modified_at"), table_name="customers")
    op.drop_index(
        op.f("ix_discount_products_modified_at"), table_name="discount_products"
    )
    op.drop_index(
        op.f("ix_discount_redemptions_modified_at"), table_name="discount_redemptions"
    )
    op.drop_index(op.f("ix_discounts_modified_at"), table_name="discounts")
    op.drop_index(op.f("ix_downloadables_modified_at"), table_name="downloadables")
    op.drop_index(
        op.f("ix_email_verification_modified_at"), table_name="email_verification"
    )
    op.drop_index(op.f("ix_external_events_modified_at"), table_name="external_events")
    op.drop_index(op.f("ix_files_modified_at"), table_name="files")
    op.drop_index(op.f("ix_held_balances_modified_at"), table_name="held_balances")
    op.drop_index(op.f("ix_issue_rewards_modified_at"), table_name="issue_rewards")
    op.drop_index(
        op.f("ix_license_key_activations_modified_at"),
        table_name="license_key_activations",
    )
    op.drop_index(op.f("ix_license_keys_modified_at"), table_name="license_keys")
    op.drop_index(op.f("ix_login_codes_modified_at"), table_name="login_codes")
    op.drop_index(op.f("ix_meters_modified_at"), table_name="meters")
    op.drop_index(
        op.f("ix_notification_recipients_modified_at"),
        table_name="notification_recipients",
    )
    op.drop_index(op.f("ix_notifications_modified_at"), table_name="notifications")
    op.drop_index(
        op.f("ix_oauth2_authorization_codes_modified_at"),
        table_name="oauth2_authorization_codes",
    )
    op.drop_index(op.f("ix_oauth2_clients_modified_at"), table_name="oauth2_clients")
    op.drop_index(op.f("ix_oauth2_grants_modified_at"), table_name="oauth2_grants")
    op.drop_index(op.f("ix_oauth2_tokens_modified_at"), table_name="oauth2_tokens")
    op.drop_index(op.f("ix_oauth_accounts_modified_at"), table_name="oauth_accounts")
    op.drop_index(op.f("ix_order_items_modified_at"), table_name="order_items")
    op.drop_index(op.f("ix_orders_modified_at"), table_name="orders")
    op.drop_index(
        op.f("ix_organization_access_tokens_modified_at"),
        table_name="organization_access_tokens",
    )
    op.drop_index(
        op.f("ix_organization_reviews_modified_at"), table_name="organization_reviews"
    )
    op.drop_index(op.f("ix_organizations_modified_at"), table_name="organizations")
    op.drop_index(op.f("ix_payment_methods_modified_at"), table_name="payment_methods")
    op.drop_index(op.f("ix_payments_modified_at"), table_name="payments")
    op.drop_index(op.f("ix_payouts_modified_at"), table_name="payouts")
    op.drop_index(
        op.f("ix_personal_access_tokens_modified_at"),
        table_name="personal_access_tokens",
    )
    op.drop_index(
        op.f("ix_pledge_transactions_modified_at"), table_name="pledge_transactions"
    )
    op.drop_index(op.f("ix_pledges_modified_at"), table_name="pledges")
    op.drop_index(
        op.f("ix_product_benefits_modified_at"), table_name="product_benefits"
    )
    op.drop_index(
        op.f("ix_product_custom_fields_modified_at"), table_name="product_custom_fields"
    )
    op.drop_index(op.f("ix_product_medias_modified_at"), table_name="product_medias")
    op.drop_index(op.f("ix_product_prices_modified_at"), table_name="product_prices")
    op.drop_index(op.f("ix_products_modified_at"), table_name="products")
    op.drop_index(op.f("ix_refunds_modified_at"), table_name="refunds")
    op.drop_index(
        op.f("ix_subscription_meters_modified_at"), table_name="subscription_meters"
    )
    op.drop_index(
        op.f("ix_subscription_product_prices_modified_at"),
        table_name="subscription_product_prices",
    )
    op.drop_index(op.f("ix_subscriptions_modified_at"), table_name="subscriptions")
    op.drop_index(op.f("ix_transactions_modified_at"), table_name="transactions")
    op.drop_index(
        op.f("ix_user_organizations_modified_at"), table_name="user_organizations"
    )
    op.drop_index(op.f("ix_user_sessions_modified_at"), table_name="user_sessions")
    op.drop_index(op.f("ix_users_modified_at"), table_name="users")
    op.drop_index(
        op.f("ix_webhook_deliveries_modified_at"), table_name="webhook_deliveries"
    )
    op.drop_index(
        op.f("ix_webhook_endpoints_modified_at"), table_name="webhook_endpoints"
    )
    op.drop_index(op.f("ix_webhook_events_modified_at"), table_name="webhook_events")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index(
        op.f("ix_webhook_events_modified_at"),
        "webhook_events",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_webhook_endpoints_modified_at"),
        "webhook_endpoints",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_webhook_deliveries_modified_at"),
        "webhook_deliveries",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_users_modified_at"), "users", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_user_sessions_modified_at"),
        "user_sessions",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_user_organizations_modified_at"),
        "user_organizations",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_transactions_modified_at"),
        "transactions",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_subscriptions_modified_at"),
        "subscriptions",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_subscription_product_prices_modified_at"),
        "subscription_product_prices",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_subscription_meters_modified_at"),
        "subscription_meters",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_refunds_modified_at"), "refunds", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_products_modified_at"), "products", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_product_prices_modified_at"),
        "product_prices",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_product_medias_modified_at"),
        "product_medias",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_product_custom_fields_modified_at"),
        "product_custom_fields",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_product_benefits_modified_at"),
        "product_benefits",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_pledges_modified_at"), "pledges", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_pledge_transactions_modified_at"),
        "pledge_transactions",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_personal_access_tokens_modified_at"),
        "personal_access_tokens",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_payouts_modified_at"), "payouts", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_payments_modified_at"), "payments", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_payment_methods_modified_at"),
        "payment_methods",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_organizations_modified_at"),
        "organizations",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_organization_reviews_modified_at"),
        "organization_reviews",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_organization_access_tokens_modified_at"),
        "organization_access_tokens",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_orders_modified_at"), "orders", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_order_items_modified_at"), "order_items", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_oauth_accounts_modified_at"),
        "oauth_accounts",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_oauth2_tokens_modified_at"),
        "oauth2_tokens",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_oauth2_grants_modified_at"),
        "oauth2_grants",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_oauth2_clients_modified_at"),
        "oauth2_clients",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_oauth2_authorization_codes_modified_at"),
        "oauth2_authorization_codes",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_notifications_modified_at"),
        "notifications",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_notification_recipients_modified_at"),
        "notification_recipients",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_meters_modified_at"), "meters", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_login_codes_modified_at"), "login_codes", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_license_keys_modified_at"),
        "license_keys",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_license_key_activations_modified_at"),
        "license_key_activations",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_issue_rewards_modified_at"),
        "issue_rewards",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_held_balances_modified_at"),
        "held_balances",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_files_modified_at"), "files", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_external_events_modified_at"),
        "external_events",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_email_verification_modified_at"),
        "email_verification",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_downloadables_modified_at"),
        "downloadables",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_discounts_modified_at"), "discounts", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_discount_redemptions_modified_at"),
        "discount_redemptions",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_discount_products_modified_at"),
        "discount_products",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_customers_modified_at"), "customers", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_customer_sessions_modified_at"),
        "customer_sessions",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_customer_session_codes_modified_at"),
        "customer_session_codes",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_customer_meters_modified_at"),
        "customer_meters",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_custom_fields_modified_at"),
        "custom_fields",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_checkouts_modified_at"), "checkouts", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_checkout_products_modified_at"),
        "checkout_products",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_checkout_links_modified_at"),
        "checkout_links",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_checkout_link_products_modified_at"),
        "checkout_link_products",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_campaigns_modified_at"), "campaigns", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_billing_entry_modified_at"),
        "billing_entry",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_benefits_modified_at"), "benefits", ["modified_at"], unique=False
    )
    op.create_index(
        op.f("ix_benefit_grants_modified_at"),
        "benefit_grants",
        ["modified_at"],
        unique=False,
    )
    op.create_index(
        op.f("ix_accounts_modified_at"), "accounts", ["modified_at"], unique=False
    )
    # ### end Alembic commands ###
