"""add_refund_fields_to_payment_orders

Revision ID: a1b2c3d4e5f6
Revises: ed59aefc83da
Create Date: 2026-06-10 12:00:00.000000
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'a1b2c3d4e5f6'
down_revision: Union[str, None] = 'ed59aefc83da'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column('payment_orders', sa.Column('refund_trade_no', sa.String(length=128), nullable=True))
    op.add_column('payment_orders', sa.Column('refunded_at', sa.DateTime(timezone=True), nullable=True))
    op.add_column('payment_orders', sa.Column('refund_amount', sa.Float(), nullable=True))


def downgrade() -> None:
    op.drop_column('payment_orders', 'refund_amount')
    op.drop_column('payment_orders', 'refunded_at')
    op.drop_column('payment_orders', 'refund_trade_no')
