|
@@ -10,16 +10,16 @@ return new class() implements MigrationInterface {
|
|
|
{
|
|
|
DB::getPdo()->exec(
|
|
|
"CREATE TABLE `announcement` (
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
- `date` datetime DEFAULT NULL,
|
|
|
- `content` text DEFAULT NULL,
|
|
|
+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '公告ID',
|
|
|
+ `date` datetime NOT NULL DEFAULT '1989-06-04 00:05:00' COMMENT '公告日期',
|
|
|
+ `content` text NOT NULL DEFAULT '' COMMENT '公告内容',
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `config` (
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
|
|
`item` varchar(255) DEFAULT NULL COMMENT '项',
|
|
|
- `value` varchar(2048) DEFAULT NULL,
|
|
|
+ `value` varchar(2048) DEFAULT NULL COMMENT '值',
|
|
|
`class` varchar(255) DEFAULT 'default' COMMENT '配置分类',
|
|
|
`is_public` int(11) DEFAULT 0 COMMENT '是否为公共参数',
|
|
|
`type` varchar(255) DEFAULT NULL COMMENT '值类型',
|
|
@@ -29,35 +29,35 @@ return new class() implements MigrationInterface {
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `detect_ban_log` (
|
|
|
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `user_name` varchar(255) DEFAULT NULL COMMENT '用户名',
|
|
|
- `user_id` bigint(20) unsigned DEFAULT NULL COMMENT '用户 ID',
|
|
|
- `email` varchar(255) DEFAULT NULL COMMENT '用户邮箱',
|
|
|
- `detect_number` int(11) DEFAULT NULL COMMENT '本次违规次数',
|
|
|
- `ban_time` int(11) DEFAULT NULL COMMENT '本次封禁时长',
|
|
|
- `start_time` bigint(20) DEFAULT NULL COMMENT '统计开始时间',
|
|
|
- `end_time` bigint(20) DEFAULT NULL COMMENT '统计结束时间',
|
|
|
- `all_detect_number` int(11) DEFAULT NULL COMMENT '累计违规次数',
|
|
|
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `user_name` varchar(255) NOT NULL DEFAULT '' COMMENT '用户名',
|
|
|
+ `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `email` varchar(255) NOT NULL DEFAULT '' COMMENT '用户邮箱',
|
|
|
+ `detect_number` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '本次违规次数',
|
|
|
+ `ban_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '本次封禁时长',
|
|
|
+ `start_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '统计开始时间',
|
|
|
+ `end_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '统计结束时间',
|
|
|
+ `all_detect_number` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '累计违规次数',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `user_id` (`user_id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `detect_list` (
|
|
|
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `name` varchar(255) DEFAULT NULL,
|
|
|
- `text` varchar(255) DEFAULT NULL,
|
|
|
- `regex` varchar(255) DEFAULT NULL,
|
|
|
- `type` int(11) DEFAULT NULL,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '审计规则ID',
|
|
|
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT '规则名称',
|
|
|
+ `text` varchar(255) NOT NULL DEFAULT '' COMMENT '规则名称',
|
|
|
+ `regex` varchar(255) NOT NULL DEFAULT '' COMMENT '正则表达式',
|
|
|
+ `type` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '规则类型',
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `detect_log` (
|
|
|
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `user_id` bigint(20) unsigned DEFAULT NULL,
|
|
|
- `list_id` bigint(20) unsigned DEFAULT NULL,
|
|
|
- `datetime` bigint(20) unsigned DEFAULT NULL,
|
|
|
- `node_id` int(11) DEFAULT NULL,
|
|
|
- `status` int(11) DEFAULT 0,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `list_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '规则ID',
|
|
|
+ `datetime` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '触发时间',
|
|
|
+ `node_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '节点ID',
|
|
|
+ `status` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '状态',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `user_id` (`user_id`),
|
|
|
KEY `node_id` (`node_id`),
|
|
@@ -66,55 +66,54 @@ return new class() implements MigrationInterface {
|
|
|
|
|
|
CREATE TABLE `docs` (
|
|
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `date` datetime DEFAULT NULL,
|
|
|
- `title` varchar(255) DEFAULT NULL,
|
|
|
- `content` varchar(255) DEFAULT NULL,
|
|
|
- `markdown` varchar(255) DEFAULT NULL,
|
|
|
+ `date` datetime NOT NULL DEFAULT '1989-06-04 00:05:00' COMMENT '文档日期',
|
|
|
+ `title` varchar(255) NOT NULL DEFAULT '' COMMENT '文档标题',
|
|
|
+ `content` longtext NOT NULL DEFAULT '' COMMENT '文档内容',
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `email_queue` (
|
|
|
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
- `to_email` varchar(255) DEFAULT NULL,
|
|
|
- `subject` varchar(255) DEFAULT NULL,
|
|
|
- `template` varchar(255) DEFAULT NULL,
|
|
|
- `array` longtext DEFAULT NULL,
|
|
|
- `time` int(11) DEFAULT NULL,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `to_email` varchar(255) NOT NULL DEFAULT '' COMMENT '收件人邮箱',
|
|
|
+ `subject` varchar(255) NOT NULL DEFAULT '' COMMENT '邮件标题',
|
|
|
+ `template` varchar(255) NOT NULL DEFAULT '' COMMENT '邮件模板',
|
|
|
+ `array` longtext NOT NULL DEFAULT '{}' COMMENT '模板参数' CHECK (json_valid(`array`)),
|
|
|
+ `time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '添加时间',
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `email_verify` (
|
|
|
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
- `email` varchar(255) DEFAULT NULL,
|
|
|
- `ip` varchar(255) DEFAULT NULL,
|
|
|
- `code` varchar(255) DEFAULT NULL,
|
|
|
- `expire_in` bigint(20) DEFAULT NULL,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `email` varchar(255) NOT NULL DEFAULT '' COMMENT '邮箱',
|
|
|
+ `ip` varchar(255) NOT NULL DEFAULT '' COMMENT 'IP',
|
|
|
+ `code` varchar(255) NOT NULL DEFAULT '' COMMENT '验证码',
|
|
|
+ `expire_in` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '过期时间',
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `gift_card` (
|
|
|
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `card` text DEFAULT NULL COMMENT '卡号',
|
|
|
- `balance` int(11) DEFAULT NULL COMMENT '余额',
|
|
|
- `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
|
|
|
- `status` int(11) DEFAULT NULL COMMENT '使用状态',
|
|
|
- `use_time` int(11) DEFAULT NULL COMMENT '使用时间',
|
|
|
- `use_user` int(11) DEFAULT NULL COMMENT '使用用户',
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '礼品卡ID',
|
|
|
+ `card` text NOT NULL DEFAULT '' COMMENT '卡号',
|
|
|
+ `balance` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '余额',
|
|
|
+ `create_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
+ `status` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '使用状态',
|
|
|
+ `use_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '使用时间',
|
|
|
+ `use_user` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '使用用户',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `id` (`id`),
|
|
|
KEY `status` (`status`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `invoice` (
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '账单ID',
|
|
|
- `user_id` int(11) DEFAULT NULL COMMENT '归属用户',
|
|
|
- `order_id` int(11) DEFAULT NULL COMMENT '订单ID',
|
|
|
- `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '账单内容' CHECK (json_valid(`content`)),
|
|
|
- `price` double DEFAULT NULL COMMENT '账单金额',
|
|
|
- `status` varchar(255) DEFAULT NULL COMMENT '账单状态',
|
|
|
- `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
|
|
|
- `update_time` int(11) DEFAULT NULL COMMENT '更新时间',
|
|
|
- `pay_time` int(11) DEFAULT NULL COMMENT '支付时间',
|
|
|
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '账单ID',
|
|
|
+ `user_id` bigint(20) unsigned DEFAULT 0 COMMENT '归属用户',
|
|
|
+ `order_id` bigint(20) unsigned DEFAULT 0 COMMENT '订单ID',
|
|
|
+ `content` longtext DEFAULT '{}' COMMENT '账单内容' CHECK (json_valid(`content`)),
|
|
|
+ `price` double unsigned DEFAULT 0 COMMENT '账单金额',
|
|
|
+ `status` varchar(255) DEFAULT '' COMMENT '账单状态',
|
|
|
+ `create_time` int(11) unsigned DEFAULT 0 COMMENT '创建时间',
|
|
|
+ `update_time` int(11) unsigned DEFAULT 0 COMMENT '更新时间',
|
|
|
+ `pay_time` int(11) unsigned DEFAULT 0 COMMENT '支付时间',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `id` (`id`),
|
|
|
KEY `user_id` (`user_id`),
|
|
@@ -123,75 +122,79 @@ return new class() implements MigrationInterface {
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `link` (
|
|
|
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
- `token` varchar(255) DEFAULT NULL,
|
|
|
- `userid` bigint(20) unsigned DEFAULT NULL,
|
|
|
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `token` varchar(255) NOT NULL DEFAULT '' COMMENT '订阅token',
|
|
|
+ `userid` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
PRIMARY KEY (`id`),
|
|
|
UNIQUE KEY `token` (`token`),
|
|
|
UNIQUE KEY `userid` (`userid`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `login_ip` (
|
|
|
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
- `userid` bigint(20) unsigned DEFAULT NULL,
|
|
|
- `ip` varchar(255) DEFAULT NULL,
|
|
|
- `datetime` bigint(20) DEFAULT NULL,
|
|
|
- `type` int(11) DEFAULT NULL,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `userid` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `ip` varchar(255) NOT NULL DEFAULT '' COMMENT '登录IP',
|
|
|
+ `datetime` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '登录时间',
|
|
|
+ `type` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '登录类型',
|
|
|
PRIMARY KEY (`id`),
|
|
|
- KEY `userid` (`userid`)
|
|
|
+ KEY `userid` (`userid`),
|
|
|
+ KEY `type` (`type`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `node` (
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
- `name` varchar(255) DEFAULT NULL,
|
|
|
- `type` int(11) DEFAULT NULL,
|
|
|
- `server` varchar(255) DEFAULT NULL,
|
|
|
- `custom_config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '{}' COMMENT '自定义配置' CHECK (json_valid(`custom_config`)),
|
|
|
- `info` text DEFAULT '',
|
|
|
- `status` varchar(255) DEFAULT '',
|
|
|
- `sort` int(11) DEFAULT NULL,
|
|
|
- `traffic_rate` float DEFAULT 1,
|
|
|
- `node_class` int(11) DEFAULT 0,
|
|
|
- `node_speedlimit` double NOT NULL DEFAULT 0 COMMENT '节点限速',
|
|
|
- `node_connector` int(11) DEFAULT 0,
|
|
|
- `node_bandwidth` bigint(20) DEFAULT 0,
|
|
|
- `node_bandwidth_limit` bigint(20) DEFAULT 0,
|
|
|
- `bandwidthlimit_resetday` int(11) DEFAULT 0,
|
|
|
- `node_heartbeat` bigint(20) DEFAULT 0,
|
|
|
- `online_user` int(11) DEFAULT 0 COMMENT '节点在线用户',
|
|
|
- `node_ip` varchar(255) DEFAULT NULL,
|
|
|
- `node_group` int(11) DEFAULT 0,
|
|
|
- `mu_only` tinyint(1) DEFAULT 0,
|
|
|
- `online` tinyint(1) DEFAULT 1,
|
|
|
- `gfw_block` tinyint(1) DEFAULT 0,
|
|
|
- `password` varchar(255) DEFAULT NULL,
|
|
|
- PRIMARY KEY (`id`)
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '节点ID',
|
|
|
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT '节点名称',
|
|
|
+ `type` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '节点显示',
|
|
|
+ `server` varchar(255) NOT NULL DEFAULT '' COMMENT '节点地址',
|
|
|
+ `custom_config` longtext NOT NULL DEFAULT '{}' COMMENT '自定义配置' CHECK (json_valid(`custom_config`)),
|
|
|
+ `info` varchar(255) NOT NULL DEFAULT '' COMMENT '节点信息',
|
|
|
+ `status` varchar(255) NOT NULL DEFAULT '' COMMENT '节点状态',
|
|
|
+ `sort` tinyint(2) unsigned NOT NULL DEFAULT 14 COMMENT '节点类型',
|
|
|
+ `traffic_rate` float unsigned NOT NULL DEFAULT 1 COMMENT '流量倍率',
|
|
|
+ `node_class` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT '节点等级',
|
|
|
+ `node_speedlimit` double unsigned NOT NULL DEFAULT 0 COMMENT '节点限速',
|
|
|
+ `node_bandwidth` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '节点流量',
|
|
|
+ `node_bandwidth_limit` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '节点流量限制',
|
|
|
+ `bandwidthlimit_resetday` tinyint(2) unsigned NOT NULL DEFAULT 0 COMMENT '流量重置日',
|
|
|
+ `node_heartbeat` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '节点心跳',
|
|
|
+ `online_user` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '节点在线用户',
|
|
|
+ `node_ip` varchar(255) NOT NULL DEFAULT '' COMMENT '节点IP',
|
|
|
+ `node_group` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT '节点群组',
|
|
|
+ `online` tinyint(1) NOT NULL DEFAULT 1 COMMENT '在线状态',
|
|
|
+ `gfw_block` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '是否被GFW封锁',
|
|
|
+ `password` varchar(255) NOT NULL DEFAULT '' COMMENT '后端连接密码',
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
+ KEY `type` (`type`),
|
|
|
+ KEY `sort` (`sort`),
|
|
|
+ KEY `node_class` (`node_class`),
|
|
|
+ KEY `node_group` (`node_group`),
|
|
|
+ KEY `online` (`online`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `online_log` (
|
|
|
- `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
- `user_id` INT UNSIGNED NOT NULL,
|
|
|
- `ip` INET6 NOT NULL,
|
|
|
- `node_id` INT UNSIGNED NOT NULL,
|
|
|
- `first_time` INT UNSIGNED NOT NULL,
|
|
|
- `last_time` INT UNSIGNED NOT NULL,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `user_id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
|
|
|
+ `ip` inet6 NOT NULL COMMENT 'IP地址',
|
|
|
+ `node_id` int(11) unsigned NOT NULL COMMENT '节点ID',
|
|
|
+ `first_time` int(11) unsigned NOT NULL COMMENT '首次在线时间',
|
|
|
+ `last_time` int(11) unsigned NOT NULL COMMENT '最后在线时间',
|
|
|
PRIMARY KEY (`id`),
|
|
|
UNIQUE KEY (`user_id`, `ip`),
|
|
|
KEY (`last_time`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `order` (
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单ID',
|
|
|
- `user_id` int(11) DEFAULT NULL COMMENT '提交用户',
|
|
|
- `product_id` int(11) DEFAULT NULL COMMENT '商品ID',
|
|
|
- `product_type` varchar(255) DEFAULT NULL COMMENT '商品类型',
|
|
|
- `product_name` varchar(255) DEFAULT NULL COMMENT '商品名称',
|
|
|
- `product_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '商品内容' CHECK (json_valid(`product_content`)),
|
|
|
- `coupon` varchar(255) DEFAULT NULL COMMENT '订单优惠码',
|
|
|
- `price` double DEFAULT NULL COMMENT '订单金额',
|
|
|
- `status` varchar(255) DEFAULT NULL COMMENT '订单状态',
|
|
|
- `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
|
|
|
- `update_time` int(11) DEFAULT NULL COMMENT '更新时间',
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID',
|
|
|
+ `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '提交用户',
|
|
|
+ `product_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '商品ID',
|
|
|
+ `product_type` varchar(255) NOT NULL DEFAULT 0 COMMENT '商品类型',
|
|
|
+ `product_name` varchar(255) NOT NULL DEFAULT 0 COMMENT '商品名称',
|
|
|
+ `product_content` longtext NOT NULL DEFAULT '{}' COMMENT '商品内容' CHECK (json_valid(`product_content`)),
|
|
|
+ `coupon` varchar(255) NOT NULL DEFAULT '' COMMENT '订单优惠码',
|
|
|
+ `price` double unsigned NOT NULL DEFAULT 0 COMMENT '订单金额',
|
|
|
+ `status` varchar(255) NOT NULL DEFAULT '' COMMENT '订单状态',
|
|
|
+ `create_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
+ `update_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `id` (`id`),
|
|
|
KEY `user_id` (`user_id`),
|
|
@@ -200,50 +203,51 @@ return new class() implements MigrationInterface {
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `payback` (
|
|
|
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
- `total` decimal(12,2) DEFAULT NULL,
|
|
|
- `userid` bigint(20) DEFAULT NULL,
|
|
|
- `ref_by` bigint(20) DEFAULT NULL,
|
|
|
- `ref_get` decimal(12,2) DEFAULT NULL,
|
|
|
- `datetime` bigint(20) DEFAULT NULL,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `total` decimal(12,2) unsigned NOT NULL DEFAULT 0 COMMENT '总金额',
|
|
|
+ `userid` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `ref_by` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '推荐人ID',
|
|
|
+ `ref_get` decimal(12,2) unsigned NOT NULL DEFAULT 0 COMMENT '推荐人获得金额',
|
|
|
+ `datetime` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `paylist` (
|
|
|
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
- `userid` bigint(20) unsigned DEFAULT NULL,
|
|
|
- `total` decimal(12,2) DEFAULT NULL,
|
|
|
- `status` int(11) DEFAULT 0,
|
|
|
- `invoice_id` int(11) DEFAULT 0,
|
|
|
- `tradeno` varchar(255) DEFAULT NULL,
|
|
|
- `gateway` varchar(255) NOT NULL DEFAULT '',
|
|
|
- `datetime` bigint(20) DEFAULT 0,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `userid` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `total` decimal(12,2) NOT NULL DEFAULT 0 COMMENT '总金额',
|
|
|
+ `status` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '状态',
|
|
|
+ `invoice_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '账单ID',
|
|
|
+ `tradeno` varchar(255) NOT NULL DEFAULT '' COMMENT '网关单号',
|
|
|
+ `gateway` varchar(255) NOT NULL DEFAULT '' COMMENT '支付网关',
|
|
|
+ `datetime` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `userid` (`userid`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `product` (
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '商品ID',
|
|
|
- `type` varchar(255) DEFAULT NULL COMMENT '类型',
|
|
|
- `name` varchar(255) DEFAULT NULL COMMENT '名称',
|
|
|
- `price` double DEFAULT NULL COMMENT '售价',
|
|
|
- `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '内容' CHECK (json_valid(`content`)),
|
|
|
- `limit` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '购买限制' CHECK (json_valid(`limit`)),
|
|
|
- `status` int(11) DEFAULT NULL COMMENT '销售状态',
|
|
|
- `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
|
|
|
- `update_time` int(11) DEFAULT NULL COMMENT '更新时间',
|
|
|
- `sale_count` int(11) DEFAULT NULL COMMENT '累计销售数',
|
|
|
- `stock` int(11) DEFAULT NULL COMMENT '库存',
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品ID',
|
|
|
+ `type` varchar(255) NOT NULL DEFAULT 'tabp' COMMENT '类型',
|
|
|
+ `name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
|
|
|
+ `price` double unsigned NOT NULL DEFAULT 0 COMMENT '售价',
|
|
|
+ `content` longtext NOT NULL DEFAULT '{}' COMMENT '内容' CHECK (json_valid(`content`)),
|
|
|
+ `limit` longtext NOT NULL DEFAULT '{}' COMMENT '购买限制' CHECK (json_valid(`limit`)),
|
|
|
+ `status` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '销售状态',
|
|
|
+ `create_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
+ `update_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',
|
|
|
+ `sale_count` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '累计销售数',
|
|
|
+ `stock` int(11) NOT NULL DEFAULT -1 COMMENT '库存',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `id` (`id`),
|
|
|
- KEY `type` (`type`)
|
|
|
+ KEY `type` (`type`),
|
|
|
+ KEY `status` (`status`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `stream_media` (
|
|
|
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `node_id` int(11) DEFAULT NULL COMMENT '节点id',
|
|
|
- `result` text DEFAULT NULL COMMENT '检测结果',
|
|
|
- `created_at` int(11) DEFAULT NULL COMMENT '创建时间',
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `node_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '节点ID',
|
|
|
+ `result` text NOT NULL DEFAULT '' COMMENT '检测结果',
|
|
|
+ `created_at` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
@@ -257,14 +261,16 @@ return new class() implements MigrationInterface {
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `ticket` (
|
|
|
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
|
|
|
- `title` varchar(255) DEFAULT NULL,
|
|
|
- `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '' COMMENT '工单内容' CHECK (json_valid(`content`)),
|
|
|
- `userid` bigint(20) DEFAULT NULL,
|
|
|
- `datetime` bigint(20) DEFAULT NULL,
|
|
|
- `status` varchar(255) DEFAULT '' COMMENT '工单状态',
|
|
|
- `type` varchar(255) DEFAULT 'other' COMMENT '工单类型',
|
|
|
- PRIMARY KEY (`id`)
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '工单ID',
|
|
|
+ `title` varchar(255) NOT NULL DEFAULT '' COMMENT '工单标题',
|
|
|
+ `content` longtext NOT NULL DEFAULT '{}' COMMENT '工单内容' CHECK (json_valid(`content`)),
|
|
|
+ `userid` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `datetime` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
+ `status` varchar(255) NOT NULL DEFAULT '' COMMENT '工单状态',
|
|
|
+ `type` varchar(255) NOT NULL DEFAULT '' COMMENT '工单类型',
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
+ KEY `userid` (`userid`),
|
|
|
+ KEY `status` (`status`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `user` (
|
|
@@ -292,12 +298,11 @@ return new class() implements MigrationInterface {
|
|
|
`reg_ip` varchar(255) NOT NULL DEFAULT '127.0.0.1' COMMENT '注册IP',
|
|
|
`node_speedlimit` double NOT NULL DEFAULT 0 COMMENT '用户限速',
|
|
|
`node_iplimit` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '同时可连接IP数',
|
|
|
- `node_connector` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '同时可使用连接数',
|
|
|
`is_admin` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '是否管理员',
|
|
|
`im_type` smallint(6) unsigned NOT NULL DEFAULT 1 COMMENT '联系方式类型',
|
|
|
`im_value` varchar(255) NOT NULL DEFAULT '' COMMENT '联系方式',
|
|
|
`daily_mail_enable` tinyint(1) NOT NULL DEFAULT 0 COMMENT '每日报告开关',
|
|
|
- `class` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '等级',
|
|
|
+ `class` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT '等级',
|
|
|
`class_expire` datetime NOT NULL DEFAULT '1989-06-04 00:05:00' COMMENT '等级过期时间',
|
|
|
`expire_in` datetime NOT NULL DEFAULT '2199-01-01 00:00:00' COMMENT '账户过期时间',
|
|
|
`theme` varchar(255) NOT NULL DEFAULT 'tabler' COMMENT '网站主题',
|
|
@@ -328,13 +333,13 @@ return new class() implements MigrationInterface {
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `user_coupon` (
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '优惠码ID',
|
|
|
- `code` varchar(255) DEFAULT NULL COMMENT '优惠码',
|
|
|
- `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '优惠码内容' CHECK (json_valid(`content`)),
|
|
|
- `limit` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '优惠码限制' CHECK (json_valid(`limit`)),
|
|
|
- `use_count` int(11) NOT NULL DEFAULT 0 COMMENT '累计使用次数',
|
|
|
- `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
|
|
|
- `expire_time` int(11) DEFAULT NULL COMMENT '过期时间',
|
|
|
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '优惠码ID',
|
|
|
+ `code` varchar(255) NOT NULL DEFAULT '' COMMENT '优惠码',
|
|
|
+ `content` longtext NOT NULL DEFAULT '{}' COMMENT '优惠码内容' CHECK (json_valid(`content`)),
|
|
|
+ `limit` longtext NOT NULL DEFAULT '{}' COMMENT '优惠码限制' CHECK (json_valid(`limit`)),
|
|
|
+ `use_count` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '累计使用次数',
|
|
|
+ `create_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
+ `expire_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '过期时间',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `id` (`id`),
|
|
|
KEY `code` (`code`),
|
|
@@ -342,28 +347,28 @@ return new class() implements MigrationInterface {
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `user_hourly_usage` (
|
|
|
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `user_id` bigint(20) unsigned DEFAULT NULL,
|
|
|
- `traffic` bigint(20) DEFAULT NULL,
|
|
|
- `hourly_usage` bigint(20) DEFAULT NULL,
|
|
|
- `datetime` int(11) DEFAULT NULL,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `traffic` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '当前总流量',
|
|
|
+ `hourly_usage` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '过去一小时流量',
|
|
|
+ `datetime` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '记录时间',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `user_id` (`user_id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `user_invite_code` (
|
|
|
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `code` varchar(255) DEFAULT NULL,
|
|
|
- `user_id` bigint(20) unsigned DEFAULT NULL,
|
|
|
- `created_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
|
|
- `updated_at` timestamp NULL DEFAULT '1989-06-04 00:05:00',
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `code` varchar(255) NOT NULL DEFAULT '' COMMENT '邀请码',
|
|
|
+ `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '创建时间',
|
|
|
+ `updated_at` timestamp NOT NULL DEFAULT '1989-06-04 00:05:00' COMMENT '更新时间',
|
|
|
PRIMARY KEY (`id`),
|
|
|
UNIQUE KEY `code` (`code`),
|
|
|
UNIQUE KEY `user_id` (`user_id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `user_money_log` (
|
|
|
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
`user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
`before` decimal(10,2) NOT NULL DEFAULT 0 COMMENT '用户变动前账户余额',
|
|
|
`after` decimal(10,2) NOT NULL DEFAULT 0 COMMENT '用户变动后账户余额',
|
|
@@ -375,23 +380,25 @@ return new class() implements MigrationInterface {
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `user_password_reset` (
|
|
|
- `id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
- `email` varchar(255) DEFAULT NULL,
|
|
|
- `token` varchar(255) DEFAULT NULL,
|
|
|
- `init_time` int(11) DEFAULT NULL,
|
|
|
- `expire_time` int(11) DEFAULT NULL,
|
|
|
- PRIMARY KEY (`id`)
|
|
|
+ `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `email` varchar(255) NOT NULL DEFAULT '' COMMENT '用户邮箱',
|
|
|
+ `token` varchar(255) NOT NULL DEFAULT '' COMMENT '重置密码的 token',
|
|
|
+ `init_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
+ `expire_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '过期时间',
|
|
|
+ PRIMARY KEY (`id`),
|
|
|
+ KEY `email` (`email`),
|
|
|
+ KEY `token` (`token`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
|
|
CREATE TABLE `user_subscribe_log` (
|
|
|
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
- `user_name` varchar(255) DEFAULT NULL COMMENT '用户名',
|
|
|
- `user_id` bigint(20) unsigned DEFAULT NULL COMMENT '用户 ID',
|
|
|
- `email` varchar(255) DEFAULT NULL COMMENT '用户邮箱',
|
|
|
- `subscribe_type` varchar(255) DEFAULT NULL COMMENT '获取的订阅类型',
|
|
|
- `request_ip` varchar(255) DEFAULT NULL COMMENT '请求 IP',
|
|
|
- `request_time` datetime DEFAULT NULL COMMENT '请求时间',
|
|
|
- `request_user_agent` text DEFAULT NULL COMMENT '请求 UA 信息',
|
|
|
+ `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '记录ID',
|
|
|
+ `user_name` varchar(255) NOT NULL DEFAULT '' COMMENT '用户名',
|
|
|
+ `user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
|
|
|
+ `email` varchar(255) NOT NULL DEFAULT '' COMMENT '用户邮箱',
|
|
|
+ `subscribe_type` varchar(255) NOT NULL DEFAULT '' COMMENT '获取的订阅类型',
|
|
|
+ `request_ip` varchar(255) NOT NULL DEFAULT '' COMMENT '请求IP',
|
|
|
+ `request_time` timestamp NOT NULL DEFAULT '1989-06-04 00:05:00' COMMENT '请求时间',
|
|
|
+ `request_user_agent` varchar(255) NOT NULL DEFAULT '' COMMENT '请求UA信息',
|
|
|
PRIMARY KEY (`id`),
|
|
|
KEY `user_id` (`user_id`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;"
|