You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
2.7 KiB
Java

-- ----------------------------
-- -
-- ----------------------------
DROP TABLE IF EXISTS `pay_member_wallet`;
CREATE TABLE `pay_member_wallet`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '',
`user_id` bigint NOT NULL COMMENT ' id',
`balance` int NOT NULL DEFAULT 0 COMMENT ', ',
`total_spending` int NOT NULL DEFAULT 0 COMMENT ', ',
`total_top_up` int NOT NULL DEFAULT 0 COMMENT ', ',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB COMMENT='';
-- ----------------------------
-- -
-- ----------------------------
DROP TABLE IF EXISTS `pay_member_wallet_transaction`;
CREATE TABLE `pay_member_wallet_transaction`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '',
`wallet_id` bigint NOT NULL COMMENT ' id',
`user_id` bigint NOT NULL COMMENT ' id',
`trade_no` varchar(64) COMMENT '',
`category` tinyint NOT NULL COMMENT '',
`operate_type` tinyint NOT NULL COMMENT '',
`operate_desc` varchar(64) NOT NULL COMMENT '',
`amount` int NOT NULL COMMENT ', ',
`balance` int NOT NULL COMMENT ', ',
`mark` varchar(512) COMMENT '',
`transaction_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB COMMENT='';