"""add_letzshop_order_locale_and_country_fields

Revision ID: a9a86cef6cca
Revises: fcfdc02d5138
Create Date: 2025-12-17 20:55:41.477848

"""
from collections.abc import Sequence

import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "a9a86cef6cca"
down_revision: str | None = "fcfdc02d5138"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
    # Add new columns to letzshop_orders for customer locale and country
    op.add_column("letzshop_orders", sa.Column("customer_locale", sa.String(length=10), nullable=True))
    op.add_column("letzshop_orders", sa.Column("shipping_country_iso", sa.String(length=5), nullable=True))
    op.add_column("letzshop_orders", sa.Column("billing_country_iso", sa.String(length=5), nullable=True))


def downgrade() -> None:
    op.drop_column("letzshop_orders", "billing_country_iso")
    op.drop_column("letzshop_orders", "shipping_country_iso")
    op.drop_column("letzshop_orders", "customer_locale")
