shop-back-end/sql/20250425_payment_log.sql

27 lines
1.3 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

DROP TABLE IF EXISTS `payment_operation_log`;
CREATE TABLE `payment_operation_log` (
`log_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '日志ID',
`order_id` BIGINT NULL COMMENT '订单ID关联shop_order.order_id',
`status` TINYINT NOT NULL DEFAULT 1 COMMENT '操作状态1成功 2失败',
`creator_id` BIGINT NOT NULL DEFAULT 0 COMMENT '创建者ID',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater_id` BIGINT NOT NULL DEFAULT 0 COMMENT '更新者ID',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`remark` TEXT DEFAULT NULL COMMENT '操作备注',
`deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '删除标志0存在 1删除',
PRIMARY KEY (`log_id`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='支付操作日志表';
ALTER TABLE `payment_operation_log`
ADD COLUMN `operation_type` VARCHAR(50) NULL DEFAULT '' COMMENT '操作类型'
AFTER `status`;
ALTER TABLE `payment_operation_log`
ADD COLUMN `params` TEXT DEFAULT NULL COMMENT '操作参数'
AFTER `remark`;
ALTER TABLE `return_approval`
ADD COLUMN `approval_time` DATETIME NULL DEFAULT CURRENT_TIMESTAMP COMMENT '审批时间'
AFTER `status`;