"""bump existing shops offer_expiration_hours 168 to 72

Revision ID: 7d6af811b6a1
Revises: 5d01b163b805
Create Date: 2026-05-14 20:42:51.956494

Default offer expiration (pre-acceptance window) dropped from 168h
(7 days) → 48h → 72h across recent commits. Existing shops kept
whatever value they had at table-create time. This migration bumps
any shop still at the literal old default 168 to the new default
72. Shops that explicitly customized via the offer-settings form
(any value other than 168) are left alone.
"""
from alembic import op
import sqlalchemy as sa


revision = "7d6af811b6a1"
down_revision = "5d01b163b805"
branch_labels = None
depends_on = None


def upgrade():
    op.execute(
        sa.text(
            "UPDATE mps_shop "
            "SET offer_expiration_hours = 72 "
            "WHERE offer_expiration_hours = 168"
        )
    )


def downgrade():
    # No safe reversal — we don't know which shops were at 168 by
    # default vs explicit. Leave them at 72 on rollback.
    pass
