13_20240617.sql 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. CREATE TABLE `distri_daily_bill` (
  2. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '账单编号',
  3. `price` bigint NOT NULL DEFAULT '0' COMMENT '金额,单位:分',
  4. `received_price` bigint NOT NULL DEFAULT '0' COMMENT '确收金额,单位:分',
  5. `order_count` bigint NOT NULL DEFAULT '0' COMMENT '订单数,默认为0',
  6. `shop_id` bigint DEFAULT NULL COMMENT '店铺ID',
  7. `merchant_id` bigint DEFAULT NULL COMMENT '商户ID',
  8. `order_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '订单ID列表',
  9. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '创建者',
  10. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  11. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '更新者',
  12. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  13. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  14. PRIMARY KEY (`id`) USING BTREE
  15. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='每日账单表'; --添加每日账单表
  16. CREATE TABLE `distri_daily_award_records` (
  17. `id` bigint NOT NULL AUTO_INCREMENT COMMENT '奖励记录ID',
  18. `user_id` bigint unsigned NOT NULL COMMENT '用户编号',
  19. `amount` bigint NOT NULL COMMENT '合赢奖金额,必填',
  20. `settled` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否已结算,默认为未结算',
  21. `log_id` bigint NOT NULL COMMENT '日志Id',
  22. `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '创建者',
  23. `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  24. `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '更新者',
  25. `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  26. `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  27. PRIMARY KEY (`id`) USING BTREE
  28. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=DYNAMIC COMMENT='每日用户获得合赢奖记录';
  29. ALTER TABLE trade_order_item
  30. ADD COLUMN transition_time datetime DEFAULT NULL COMMENT '订单项金额转换冻结的时间(合赢奖)';
  31. ALTER TABLE distri_integral
  32. ADD freeze_high_quota BIGINT NOT NULL DEFAULT '0' COMMENT '冻结的最高可获取积分';
  33. ALTER TABLE distri_pt_profit_log
  34. ADD COLUMN freeze_high_quota BIGINT DEFAULT NULL COMMENT '变动的冻结最大可用额度',
  35. ADD COLUMN after_freeze_high_quota BIGINT DEFAULT NULL COMMENT '变动后的冻结最大可用额度';
  36. ALTER TABLE trade_order_item
  37. ADD COLUMN freeze_high_quota BIGINT DEFAULT NULL COMMENT '用户获得冻结最大可用额度';
  38. ALTER TABLE trade_order_item
  39. ADD COLUMN high_precision_price DECIMAL(11,6) DEFAULT 0 COMMENT '高精度价格';
  40. ALTER TABLE distri_integral
  41. ADD COLUMN `high_quota_total` bigint(11) DEFAULT '0' COMMENT '累计获取的峰值';