cyywl_server/sql/optional/mall/coupon.sql

85 lines
11 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

DROP TABLE IF EXISTS `coupon`;
CREATE TABLE `coupon`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ' reward- discount- random-',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '',
`coupon_type_id` bigint UNSIGNED DEFAULT 0 COMMENT 'id',
`coupon_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '',
`member_id` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`use_order_id` bigint UNSIGNED NOT NULL DEFAULT 0 COMMENT '使id',
`goods_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1-2-3-',
`goods_ids` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'id',
`at_least` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`money` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`discount` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 =< <= 9.9 typediscount',
`discount_limit` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT ' typediscount',
`whether_forbid_preference` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT ' 0- 1- ',
`whether_expire_notice` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0- 1-',
`expire_notice_fixed_term` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'N',
`whether_noticed` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`state` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT ' 1使 2使 3',
`get_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '12.3. 4 5',
`fetch_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`use_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使',
`start_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '使',
`end_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP 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
AUTO_INCREMENT = 119
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '';
DROP TABLE IF EXISTS `coupon_templete`;
CREATE TABLE `coupon_templete`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
`type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ' reward- discount- random-',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '',
`coupon_name_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '',
`image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '',
`count` int(11) NOT NULL DEFAULT 0 COMMENT '',
`lead_count` int(11) NOT NULL DEFAULT 0 COMMENT '',
`used_count` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使',
`goods_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '1-2-3-',
`product_ids` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'id',
`has_use_limit` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使0- 1-',
`at_least` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '使 0',
`money` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT ' typereward',
`discount` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 =< <= 9.9 typediscount',
`discount_limit` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT ' typediscount',
`min_money` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT ' typeradom',
`max_money` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT ' typeradom',
`validity_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1- 2- 3-',
`start_use_time` datetime COMMENT '使 1',
`end_use_time` datetime COMMENT '使 1',
`fixed_term` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'validity_type23 N',
`whether_limitless` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0- 1',
`max_fetch` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`whether_expire_notice` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0- 1-',
`expire_notice_fixed_term` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'N',
`whether_forbid_preference` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT ' 0- 1- ',
`whether_show` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`discount_order_money` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`order_money` decimal(10, 2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '',
`whether_forbidden` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0- 1-',
`order_goods_num` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使',
`status` tinyint(11) NOT NULL DEFAULT 0 COMMENT '12-1',
`end_time` datetime 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
AUTO_INCREMENT = 119
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT = '';