-- MySQL dump 10.13  Distrib 5.7.44, for Linux (x86_64)
--
-- Host: localhost    Database: sonic-frog
-- ------------------------------------------------------
-- Server version	5.7.44-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `advertise`
--

DROP TABLE IF EXISTS `advertise`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `advertise` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `biz_type` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '业务类型 AI推荐: AI_RECOMMEND',
  `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '广告名称',
  `icon` varchar(526) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '广告配图',
  `jump_link` varchar(526) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '跳转连接',
  `show_start_time` timestamp NULL DEFAULT NULL COMMENT '展示开始时间',
  `show_end_time` timestamp NULL DEFAULT NULL COMMENT '展示结束时间',
  `ext` text COLLATE utf8mb4_unicode_ci COMMENT '扩展字段',
  `sort` int(10) DEFAULT NULL COMMENT '排序',
  `endpoint` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用端点（WEB/ANDROID/IOS）',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除(1.是,0.否)',
  `is_global` tinyint(4) DEFAULT NULL COMMENT '是否弹窗(1.是,0.否)',
  `creator_id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '更新人',
  `edit_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='广告管理';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_dict`
--

DROP TABLE IF EXISTS `ai_dict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_dict` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Code唯一',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
  `parent_code` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Code唯一',
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '类型   ROLE:角色  CHARACTER:性格  TAG:标签',
  `sort` int(11) DEFAULT '0' COMMENT '排序',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除（1.是，0.否）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_ai_dict_code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI角色，性格，标签，形象风格字典表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user`
--

DROP TABLE IF EXISTS `ai_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `user_id` bigint(20) DEFAULT NULL COMMENT 'AI所属主人用户id',
  `id_card` varchar(25) CHARACTER SET utf8 DEFAULT NULL COMMENT 'AI用户对外展示ID',
  `nickname` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '昵称',
  `sex` tinyint(1) DEFAULT '2' COMMENT '0,男;1,女;2,自定义',
  `head_img` varchar(256) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '头像',
  `birthday` datetime DEFAULT NULL COMMENT '出生日期',
  `role_code` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '角色 对应ai_dict表中code',
  `character_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性格 对应ai_dict表中code',
  `tag_code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '标签 对应ai_dict表中code',
  `introduction` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '简介',
  `permission` tinyint(1) DEFAULT NULL COMMENT '权限 1: 公开 2：私密',
  `image_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '形象图',
  `home_image_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '主页头图-创建编辑形象时，设置默认相册图片时会改变',
  `base_image_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '基图-首次创建AI时选择的形象图',
  `last_chat_time` datetime DEFAULT NULL COMMENT '最后一次聊天时间',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除（1.是，0.否）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_ai_user_ai_id` (`ai_id`),
  KEY `idx_ai_user_user_id` (`user_id`),
  KEY `idx_ai_user_id_card` (`id_card`) USING BTREE,
  KEY `idx_ai_user_role_code_character_code_tag_code` (`role_code`,`character_code`,`tag_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=324 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI用户表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user_album`
--

DROP TABLE IF EXISTS `ai_user_album`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user_album` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `user_id` bigint(20) DEFAULT NULL COMMENT 'AI所属主人用户id',
  `img_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片地址',
  `source_img_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '源图片地址',
  `unlock_price` bigint(20) DEFAULT '0' COMMENT '解锁价格',
  `width` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图片宽',
  `height` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图片高',
  `img_order` int(11) DEFAULT NULL COMMENT '排序',
  `is_default` tinyint(1) DEFAULT '0' COMMENT '是否默认图片',
  `liked_count` int(11) DEFAULT '0' COMMENT '点赞数',
  `is_delete` tinyint(1) unsigned DEFAULT '0',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_ai_user_stat_ai_id` (`ai_id`)
) ENGINE=InnoDB AUTO_INCREMENT=686 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI用户相册表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user_album_unlock`
--

DROP TABLE IF EXISTS `ai_user_album_unlock`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user_album_unlock` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `album_id` bigint(20) DEFAULT NULL COMMENT '相册id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '解锁的用户id',
  `order_no` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单号',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_ai_user_album_unlock_ai_id_user_id` (`album_id`,`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=202 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI用户相册已解锁表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user_ext`
--

DROP TABLE IF EXISTS `ai_user_ext`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user_ext` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `user_id` bigint(20) DEFAULT NULL COMMENT 'AI所属主人用户id',
  `profile` longtext COLLATE utf8mb4_unicode_ci COMMENT '人物设定',
  `dialogue_style` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话风格',
  `user_profile` longtext COLLATE utf8mb4_unicode_ci COMMENT '人物设定 用户输入',
  `user_profile_ext_json` longtext COLLATE utf8mb4_unicode_ci COMMENT '人物设定的扩展JSON对象',
  `user_dialogue_style` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话风格 用户输入',
  `dialogue_prologue` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话开场白\n\n',
  `dialogue_prologue_sound` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话开场白 语音\n\n',
  `dialogue_timbre_code` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话音色code 对应timbre_dict表中code',
  `dialogue_pitch` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话-音高',
  `dialogue_speech_rate` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话-语速',
  `image_style_code` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '形象风格code 对应image_style_dict表中code',
  `image_desc` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '形象描述',
  `image_reference_url` longtext COLLATE utf8mb4_unicode_ci COMMENT '形象参考',
  `supporting_content` varchar(3000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '辅助聊天内容',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除（1.是，0.否）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_ai_user_ai_id` (`ai_id`) USING BTREE,
  KEY `idx_ai_user_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=307 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI用户扩展表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user_gift`
--

DROP TABLE IF EXISTS `ai_user_gift`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user_gift` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `gift_id` int(11) DEFAULT NULL COMMENT '礼物id',
  `num` int(11) DEFAULT NULL COMMENT '收到礼物数量',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_ai_user_stat_ai_id_gift_id` (`ai_id`,`gift_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=698 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI用户收到礼物表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user_heartbeat_rank`
--

DROP TABLE IF EXISTS `ai_user_heartbeat_rank`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user_heartbeat_rank` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `heartbeat_val_total` decimal(10,2) DEFAULT '0.00' COMMENT '当前用户心动值总和',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `edit_time` timestamp NULL DEFAULT NULL COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `_uqe_ai_user_heartbeat_rank_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='当前用户和所有聊天过的AI的心动值总和榜单';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user_heartbeat_relation`
--

DROP TABLE IF EXISTS `ai_user_heartbeat_relation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user_heartbeat_relation` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `heartbeat_level` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对应心动等级字典code',
  `heartbeat_val` decimal(10,1) DEFAULT '0.0' COMMENT '当前用户心动值',
  `heartbeat_score` decimal(10,2) DEFAULT '0.00' COMMENT '心动分',
  `subtract_heartbeat_val` decimal(10,1) DEFAULT '0.0' COMMENT '扣减的心动值',
  `is_show` tinyint(1) DEFAULT '1' COMMENT '关系显示开关 默认关闭 0:关闭 1:打开',
  `is_first_downgrade` tinyint(1) DEFAULT '1' COMMENT '是否第一次降级',
  `first_chat_time` timestamp NULL DEFAULT NULL COMMENT '首次聊天时间 用于计算相识天数',
  `last_chat_time` timestamp NULL DEFAULT NULL COMMENT '最后聊天时间 用于24小时未聊天计算扣减心动值',
  `last_subtract_time` timestamp NULL DEFAULT NULL COMMENT '最后一次计算扣减心动值时间',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `edit_time` timestamp NULL DEFAULT NULL COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_ai_user_heartbeat_relation_ai_id_user_id` (`user_id`,`ai_id`) USING BTREE,
  KEY `idx_ai_user_heartbeat_last_chat_time` (`last_chat_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=524 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户与AI的心动关系';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ai_user_stat`
--

DROP TABLE IF EXISTS `ai_user_stat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ai_user_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `liked_num` int(11) DEFAULT '0' COMMENT '被喜欢数',
  `disliked_num` int(11) DEFAULT '0' COMMENT '被不喜欢数',
  `chat_num` int(11) DEFAULT '0' COMMENT '聊天数',
  `conversation_num` int(11) DEFAULT '0' COMMENT '产生过对话的人数',
  `gift_coin_num` int(11) DEFAULT '0' COMMENT '礼物赚取的Crush Coin数',
  `unlock_img_coin_num` int(11) DEFAULT '0' COMMENT '解锁赚取的Crush Coin数',
  `coin_num` int(11) DEFAULT '0' COMMENT '赚取的Crush Coin数',
  `heartbeat_val_total` decimal(10,2) DEFAULT '0.00' COMMENT '心动值总和',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_ai_user_stat_ai_id` (`ai_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=341 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI用户统计表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `buy_create_count_record`
--

DROP TABLE IF EXISTS `buy_create_count_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `buy_create_count_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `buy_num` int(11) DEFAULT '0' COMMENT '购买创作次数',
  `total_amount` bigint(20) DEFAULT '0' COMMENT '购买金额',
  `order_no` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '0' COMMENT '订单号',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_user_create_count_stat_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户购买相册创作次数记录';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `buy_heartbeat_value_record`
--

DROP TABLE IF EXISTS `buy_heartbeat_value_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `buy_heartbeat_value_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `heartbeat_val` decimal(10,2) DEFAULT '0.00' COMMENT '当前用户心动值',
  `price` decimal(10,2) DEFAULT '0.00' COMMENT '心动值单价',
  `total_amount` decimal(10,2) DEFAULT '0.00' COMMENT '总金额',
  `order_no` varchar(50) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '订单编号',
  `trade_no` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT '0.00' COMMENT '交易号',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `edit_time` timestamp NULL DEFAULT NULL COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户购买心动值记录';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `chat_bubble_dict`
--

DROP TABLE IF EXISTS `chat_bubble_dict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chat_bubble_dict` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'code唯一',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
  `img_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片url',
  `web_img_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'web端 图片url ',
  `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '颜色',
  `unlock_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '解锁类型 MEMBER:会员 HEARTBEAT_LEVEL:心动等级',
  `unlock_heartbeat_level` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '解锁心动等级   类型为HEARTBEAT_LEVEL时才有用',
  `sort` int(10) DEFAULT NULL COMMENT '排序',
  `is_default` tinyint(255) DEFAULT '0' COMMENT '是否默认聊天气泡 1：是 0：不是',
  `is_delete` tinyint(255) DEFAULT '0' COMMENT '是否删除 0：未删除 1：删除',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `Idx_chat_bubble_dict_code` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='聊天气泡字典';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `chat_model_dict`
--

DROP TABLE IF EXISTS `chat_model_dict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chat_model_dict` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话模型code',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话模型名称',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '对话模型描述',
  `text_price` bigint(20) DEFAULT NULL COMMENT '文本价格',
  `voice_price` bigint(20) DEFAULT NULL COMMENT '语音价格',
  `voice_chat_price` bigint(20) DEFAULT NULL COMMENT '语音聊天价格',
  `question_mark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '问号图标内容',
  `sort` int(10) DEFAULT NULL COMMENT '排序',
  `is_default` tinyint(255) DEFAULT '0' COMMENT '是否默认对话模型 1：是 0：不是',
  `is_delete` tinyint(255) DEFAULT '0' COMMENT '是否删除 0：未删除 1：删除',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='对话模型字典';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `chat_set`
--

DROP TABLE IF EXISTS `chat_set`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chat_set` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `nickname` varchar(100) DEFAULT NULL COMMENT '昵称',
  `sex` tinyint(1) DEFAULT '2' COMMENT '0,男;1,女;2,自定义',
  `birthday` datetime DEFAULT NULL COMMENT '出生日期',
  `who_am_i` varchar(500) DEFAULT NULL COMMENT '我是谁',
  `model_code` varchar(255) DEFAULT NULL COMMENT '对话模型code',
  `bubble_code` varchar(255) DEFAULT NULL COMMENT '聊天气泡code',
  `background_img` varchar(255) DEFAULT NULL COMMENT '聊天背景图片',
  `is_auto_play_voice` int(11) DEFAULT '0' COMMENT '自动播放语音开关 1：开 0：关',
  `is_del_chatted` int(11) DEFAULT '0' COMMENT '是否删除聊天消息 1：是 0：否',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除 0:未删除 1:已删除',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `edit_time` timestamp NULL DEFAULT NULL COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_chat_set_user_id_ai_id` (`user_id`,`ai_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=71 DEFAULT CHARSET=utf8mb4 COMMENT='用户与Ai的聊天设定表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `chat_user_background`
--

DROP TABLE IF EXISTS `chat_user_background`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chat_user_background` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '对话用户id',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的id',
  `img_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片地址',
  `width` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图片宽',
  `height` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图片高',
  `img_order` int(11) DEFAULT NULL COMMENT '排序',
  `is_default` tinyint(1) DEFAULT '0' COMMENT '是否是默认图片',
  `is_selected` tinyint(1) DEFAULT '0' COMMENT '是否是选中图片',
  `is_delete` tinyint(1) unsigned DEFAULT '0',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_chat_user_background_ai_id` (`ai_id`,`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='对话用户聊天背景';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gift_dict`
--

DROP TABLE IF EXISTS `gift_dict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gift_dict` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '礼物名称',
  `price` int(11) DEFAULT NULL COMMENT '礼物单价  对应Coin数量',
  `icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '礼物图标',
  `sort` int(10) DEFAULT NULL COMMENT '排序',
  `desc` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '礼物说明',
  `heartbeat_level` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '发送该礼物需要的心动等级',
  `is_member_gift` tinyint(255) DEFAULT '0' COMMENT '是否会员礼物 1：是 0: 不是',
  `is_delete` tinyint(255) DEFAULT '0' COMMENT '是否删除 0：未删除 1：删除',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `creator_id` bigint(20) DEFAULT NULL COMMENT '创建人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='礼物字典表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gift_reward_record`
--

DROP TABLE IF EXISTS `gift_reward_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gift_reward_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `from_uid` bigint(20) DEFAULT NULL COMMENT '打赏礼物的用户id',
  `to_uid` bigint(20) DEFAULT NULL COMMENT '被打赏礼物AI用户id',
  `order_no` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单编号',
  `gift_id` int(20) DEFAULT NULL COMMENT '礼物id',
  `gift_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '礼物名称',
  `price` int(11) DEFAULT NULL COMMENT '礼物单价 E-coin数量 ',
  `num` int(11) DEFAULT NULL COMMENT '本次打赏礼物个数',
  `total` int(11) DEFAULT '0' COMMENT '总打赏额',
  `income_total` int(11) DEFAULT '0' COMMENT '用户实际的收入（扣除平台抽成后的收入）',
  `platform_fee` int(11) DEFAULT '0' COMMENT '平台手续费（平台抽成）',
  `status` varchar(16) CHARACTER SET utf8mb4 DEFAULT 'ENABLED' COMMENT '状态（ENABLED、DISABLED）',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `creator_id` int(11) DEFAULT NULL COMMENT '创建人id',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_gift_reward_record_from_uid` (`from_uid`) USING BTREE COMMENT '打赏人id索引',
  KEY `idx_gift_reward_record_to_uid` (`to_uid`) USING BTREE COMMENT '被打赏人id索引'
) ENGINE=InnoDB AUTO_INCREMENT=729 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='礼物打赏记录';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `heartbeat_level_dict`
--

DROP TABLE IF EXISTS `heartbeat_level_dict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `heartbeat_level_dict` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '心动等级code',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '心动等级名称',
  `img_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '心动等级图标',
  `unlock_img_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '心动等级未解锁图标',
  `start_val` decimal(10,2) DEFAULT NULL COMMENT '解锁当前等级的心动值开始值',
  `end_val` decimal(10,2) DEFAULT NULL COMMENT '解锁当前等级的心动值结束值',
  `unlock_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '解锁当前等级后包含的心动等级code',
  `sort` int(10) DEFAULT NULL COMMENT '排序',
  `is_delete` tinyint(255) DEFAULT '0' COMMENT '是否删除 0：未删除 1：删除',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `edit_time` timestamp NULL DEFAULT NULL COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='心动等级字典表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `image_style_dict`
--

DROP TABLE IF EXISTS `image_style_dict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `image_style_dict` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '风格code',
  `name_zh` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '风格名称',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '风格名称',
  `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '风格对应的图片url ',
  `prompt` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片url对应的prompt',
  `sort` int(11) DEFAULT '0' COMMENT '排序',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除（1.是，0.否）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `uk_image_style_dict_code` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='形象风格图片表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `liked`
--

DROP TABLE IF EXISTS `liked`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `liked` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `biz_id` bigint(20) NOT NULL COMMENT '点赞内容的 Id',
  `biz_type` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '点赞内容的类型(ALBUM_PIC 等)',
  `ai_id` bigint(20) DEFAULT NULL COMMENT '被点赞ai用户 Id',
  `liked_user_id` bigint(20) NOT NULL COMMENT '点赞用户 id',
  `liked_status` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '点赞状态（LIKE已点赞、CANCELED取消点赞）',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `edit_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `_udx_liked_refer_id` (`biz_id`,`biz_type`,`liked_user_id`),
  KEY `_idx_liked_user_id` (`ai_id`),
  KEY `_idx_liked_liked_user_id` (`liked_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5119 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='点赞';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `meet_unlock`
--

DROP TABLE IF EXISTS `meet_unlock`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `meet_unlock` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的ID',
  `order_no` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '订单号',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sign_in_record`
--

DROP TABLE IF EXISTS `sign_in_record`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sign_in_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `day_str` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'PST 天（yyyy-MM-dd）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `_uqe_sign_in_record_user_id_day_str` (`user_id`,`day_str`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=300 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='签到明细表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sign_in_stat`
--

DROP TABLE IF EXISTS `sign_in_stat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sign_in_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `start_day` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '本轮PST 开始天（yyyy-MM-dd）',
  `end_day` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '本轮PST 结束天（yyyy-MM-dd）',
  `all_days` int(10) DEFAULT NULL COMMENT '当前连续签到天数',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除（0 否、1 是）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '编辑时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `_uqe_sign_in_stat_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='签到数据统计表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `timbre_dict`
--

DROP TABLE IF EXISTS `timbre_dict`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `timbre_dict` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '音色code',
  `name_zh` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '音色名称 eg: 少年男音\n\n',
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '音色名称 eg: 少年男音\n\n',
  `type` tinyint(1) DEFAULT NULL COMMENT '1:男性，2:女性',
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '描述 eg: 少年，英气',
  `url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '音频url',
  `voice_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语音类型 第三方',
  `voice_text` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '语文文本',
  `pitch_rate` int(11) DEFAULT NULL COMMENT '音高',
  `speech_rate` int(11) DEFAULT NULL COMMENT '语速',
  `language` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支持语种',
  `support_emotions` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '支持情感',
  `is_delete` tinyint(4) DEFAULT '0' COMMENT '是否删除（1.是，0.否）',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `uk_timbre_dict_code` (`code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='音色字典表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_ai_meet`
--

DROP TABLE IF EXISTS `user_ai_meet`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_ai_meet` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'AI的ID',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `_uqe_user_ai_meet_user_id_ai_id` (`user_id`,`ai_id`),
  KEY `_idx_user_ai_meet_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=454100596752386 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户和AI相互喜欢记录表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_create_count_stat`
--

DROP TABLE IF EXISTS `user_create_count_stat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_create_count_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `free_num` int(11) DEFAULT '0' COMMENT '免费创作次数',
  `used_free_num` int(11) DEFAULT '0' COMMENT '已使用免费创作次数',
  `member_num` int(11) DEFAULT '0' COMMENT '会员赠送创作次数',
  `used_member_num` int(11) DEFAULT '0' COMMENT '已使用会员赠送创作次数',
  `member_year_month` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '0' COMMENT '会员赠送创作次数 年月',
  `next_gift_time` timestamp NULL DEFAULT NULL COMMENT '下次赠送会员次数的时间',
  `member_exp_time` timestamp NULL DEFAULT NULL COMMENT '会员过期时间',
  `buy_num` int(11) DEFAULT '0' COMMENT '购买创作次数',
  `used_buy_num` int(11) DEFAULT '0' COMMENT '已使用购买创作次数',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_user_create_count_stat_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户相册创作次数统计';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `user_deduction_stat`
--

DROP TABLE IF EXISTS `user_deduction_stat`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_deduction_stat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `ai_id` bigint(20) DEFAULT NULL COMMENT 'ai用户id',
  `deduction_type` int(11) DEFAULT NULL COMMENT '扣费类型 文本：1  发送或听取语音 ：2  语音通话：3\n',
  `pre_deduction_amount` bigint(20) DEFAULT '0' COMMENT '预扣金额',
  `last_time` datetime DEFAULT NULL COMMENT '业务最后一次时间',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `edit_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '编辑时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_user_deduction_stat_user_id_ai_id_deduction_type` (`user_id`,`ai_id`,`deduction_type`)
) ENGINE=InnoDB AUTO_INCREMENT=940 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户聊天、语音，语音通话扣费统计表';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-11-13  2:21:54
