-- Active: xiaoding_test@@192.168.110.85@3306@xiaoding_test
-- 分销团队表
DROP TABLE IF EXISTS `market_dist_teams`;
CREATE TABLE IF NOT EXISTS `market_dist_teams` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '分销团队编号',
 `object_id` bigint unsigned NOT NULL COMMENT '对象编号',
 `object_type` varchar(255) NOT NULL COMMENT '对象类型',
 `user_id` bigint unsigned NOT NULL COMMENT '被邀用户编号',
 `level` varchar(255) NOT NULL DEFAULT '1' COMMENT '层级',
 `state` varchar(255) NOT NULL DEFAULT 'ENABLE' COMMENT '状态',
 `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
 `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
 `deleted_at` timestamp NULL DEFAULT NULL COMMENT '删除时间',
 PRIMARY KEY (`id`),
 UNIQUE KEY `uk_object_user` (
 `object_id`,
 `object_type`,
 `user_id`
 ),
 KEY `idx_user_id` (`user_id`),
CONSTRAINT `fk_dist_teams_user_id` FOREIGN KEY (`user_id`) REFERENCES `member_users` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '分销团队表';