etrade_order_1.0.28.20241016.sql 1.43 KB
ALTER TABLE `dili_xtrade`.`order` 
ADD COLUMN `total_refund_amount` bigint NULL DEFAULT 0 COMMENT '总退款金额';

use dili_xtrade;
CREATE TABLE `order_refund` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `refund_id` varchar(60)  DEFAULT NULL COMMENT '退款单号',
  `order_id` bigint NOT NULL COMMENT '交易订单自增id',
  `order_code` varchar(60)  NOT NULL COMMENT '交易订单编号',
  `market_id` bigint NOT NULL COMMENT '市场id',
  `refund_amount` bigint NOT NULL COMMENT '退款金额(分)',
  `refund_message` varchar(120)  DEFAULT NULL COMMENT '退款说明',
  `state` tinyint NOT NULL COMMENT '退款状态',
  `notic` varchar(100)  DEFAULT NULL COMMENT '退款失败说明',
  `trade_id` varchar(40)  DEFAULT NULL COMMENT '支付单号',
  `order_payment_id` bigint DEFAULT NULL COMMENT '订单支付单主键',
  `version` int DEFAULT NULL,
  `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `refund_time` datetime DEFAULT NULL COMMENT '退款完成时间',
  `create_id` bigint DEFAULT NULL COMMENT '发起退款人id',
  `create_name` varchar(60)  DEFAULT NULL COMMENT '发起退款人名称',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `orderId` (`order_id`,`market_id`) USING BTREE,
  KEY `refundId` (`refund_id`)
) ENGINE=InnoDB COMMENT='电子交易订单-结算单';