ALTER TABLE qipai_recharge_orders
  ADD COLUMN payment_provider VARCHAR(32) NOT NULL DEFAULT 'WECHAT' AFTER payment_id,
  ADD COLUMN provider_prepay_id VARCHAR(128) NULL AFTER payment_provider,
  ADD COLUMN provider_payment_id VARCHAR(128) NULL AFTER provider_prepay_id,
  ADD COLUMN provider_callback_id VARCHAR(128) NULL AFTER provider_payment_id,
  ADD COLUMN raw_notify JSON NULL AFTER provider_callback_id,
  ADD UNIQUE KEY uq_qipai_recharge_provider_payment
    (tenant_id, payment_provider, provider_payment_id),
  ADD UNIQUE KEY uq_qipai_recharge_provider_callback
    (tenant_id, payment_provider, provider_callback_id);

INSERT IGNORE INTO qipai_schema_migrations (version, name)
VALUES ('2026062524', 'm08a_recharge_wechat');
