CREATE TABLE `wa_payment_refund` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `order_no` varchar(50) NOT NULL COMMENT '原订单号',
  `refund_no` varchar(50) NOT NULL COMMENT '退款单号',
  `pay_type` varchar(20) NOT NULL COMMENT '支付类型: alipay, wechat',
  `amount` decimal(10,2) NOT NULL COMMENT '退款金额',
  `reason` varchar(255) NOT NULL COMMENT '退款原因',
  `status` varchar(20) NOT NULL DEFAULT 'SUCCESS' COMMENT '退款状态: SUCCESS, FAIL',
  `extra` text COMMENT '额外信息',
  `created_at` int NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `refund_no` (`refund_no`),
  KEY `order_no` (`order_no`),
  KEY `pay_type` (`pay_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='退款表';
