20171129.sql 1.2 KB

1234567891011121314151617181920212223242526
  1. INSERT INTO `country` VALUES ('40', '阿联酋', 'ae');
  2. INSERT INTO `country` VALUES ('41', '南非', 'za');
  3. INSERT INTO `country` VALUES ('42', '缅甸', 'mm');
  4. INSERT INTO `country` VALUES ('43', '冰岛', 'is');
  5. INSERT INTO `country` VALUES ('44', '芬兰', 'fi');
  6. INSERT INTO `country` VALUES ('45', '卢森堡', 'lu');
  7. INSERT INTO `country` VALUES ('46', '比利时', 'be');
  8. -- 用户余额字段由decimal改为int,数值变大十倍
  9. ALTER TABLE `user` MODIFY `balance` int(11) NOT NULL DEFAULT '0' COMMENT '余额,单位分'
  10. UPDATE `user` SET balance = balance * 100;
  11. DROP TABLE `user_balance_log`;
  12. CREATE TABLE `user_balance_log` (
  13. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  14. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '账号ID',
  15. `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID',
  16. `before` int(11) NOT NULL DEFAULT '0' COMMENT '发生前余额,单位分',
  17. `after` int(11) NOT NULL DEFAULT '0' COMMENT '发生后金额,单位分',
  18. `amount` int(11) NOT NULL DEFAULT '0' COMMENT '发生金额,单位分',
  19. `desc` varchar(255) DEFAULT '' COMMENT '操作描述',
  20. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  21. PRIMARY KEY (`id`)
  22. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;