|
@@ -120,7 +120,7 @@ return new class() implements MigrationInterface {
|
|
|
`user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '归属用户ID',
|
|
|
`order_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '订单ID',
|
|
|
`content` longtext NOT NULL DEFAULT '{}' COMMENT '账单内容' CHECK (json_valid(`content`)),
|
|
|
- `price` double unsigned NOT NULL DEFAULT 0 COMMENT '账单金额',
|
|
|
+ `price` decimal(12,2) 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 '更新时间',
|
|
@@ -160,12 +160,12 @@ return new class() implements MigrationInterface {
|
|
|
`server` varchar(255) NOT NULL DEFAULT '' COMMENT '节点地址',
|
|
|
`custom_config` longtext NOT NULL DEFAULT '{}' COMMENT '自定义配置' CHECK (json_valid(`custom_config`)),
|
|
|
`sort` tinyint(2) unsigned NOT NULL DEFAULT 14 COMMENT '节点类型',
|
|
|
- `traffic_rate` double unsigned NOT NULL DEFAULT 1 COMMENT '流量倍率',
|
|
|
+ `traffic_rate` decimal(5,2) unsigned NOT NULL DEFAULT 1 COMMENT '流量倍率',
|
|
|
`is_dynamic_rate` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '是否启用动态流量倍率',
|
|
|
`dynamic_rate_type` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '动态流量倍率计算方式',
|
|
|
`dynamic_rate_config` longtext NOT NULL DEFAULT '{}' COMMENT '动态流量倍率配置' CHECK (json_valid(`custom_config`)),
|
|
|
`node_class` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT '节点等级',
|
|
|
- `node_speedlimit` double unsigned NOT NULL DEFAULT 0 COMMENT '节点限速',
|
|
|
+ `node_speedlimit` smallint(6) 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 '流量重置日',
|
|
@@ -209,7 +209,7 @@ return new class() implements MigrationInterface {
|
|
|
`product_name` varchar(255) NOT NULL DEFAULT '' 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 '订单金额',
|
|
|
+ `price` decimal(12,2) 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 '更新时间',
|
|
@@ -241,7 +241,7 @@ return new class() implements MigrationInterface {
|
|
|
`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 '网关单号',
|
|
|
+ `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`),
|
|
@@ -255,7 +255,7 @@ return new class() implements MigrationInterface {
|
|
|
`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 '售价',
|
|
|
+ `price` decimal(12,2) 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 '销售状态',
|
|
@@ -335,17 +335,17 @@ return new class() implements MigrationInterface {
|
|
|
`last_check_in_time` int(11) unsigned DEFAULT 0 COMMENT '最后签到时间',
|
|
|
`last_login_time` int(11) unsigned DEFAULT 0 COMMENT '最后登录时间',
|
|
|
`reg_date` datetime NOT NULL DEFAULT '1989-06-04 00:05:00' COMMENT '注册时间',
|
|
|
- `money` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '账户余额',
|
|
|
+ `money` decimal(12,2) NOT NULL DEFAULT 0.00 COMMENT '账户余额',
|
|
|
`ref_by` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '邀请人ID',
|
|
|
`method` varchar(255) NOT NULL DEFAULT 'aes-128-gcm' COMMENT '加密方式',
|
|
|
`reg_ip` varchar(255) NOT NULL DEFAULT '127.0.0.1' COMMENT '注册IP',
|
|
|
- `node_speedlimit` double NOT NULL DEFAULT 0 COMMENT '用户限速',
|
|
|
+ `node_speedlimit` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '用户限速',
|
|
|
`node_iplimit` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '同时可连接IP数',
|
|
|
`is_admin` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '是否管理员',
|
|
|
- `im_type` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '联系方式类型',
|
|
|
+ `im_type` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT '联系方式类型',
|
|
|
`im_value` varchar(255) NOT NULL DEFAULT '' COMMENT '联系方式',
|
|
|
- `contact_method` smallint(6) NOT NULL DEFAULT 1 COMMENT '偏好的联系方式',
|
|
|
- `daily_mail_enable` tinyint(1) NOT NULL DEFAULT 0 COMMENT '每日报告开关',
|
|
|
+ `contact_method` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '偏好的联系方式',
|
|
|
+ `daily_mail_enable` tinyint(1) 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 '等级过期时间',
|
|
|
`theme` varchar(255) NOT NULL DEFAULT 'tabler' COMMENT '网站主题',
|
|
@@ -371,6 +371,10 @@ return new class() implements MigrationInterface {
|
|
|
UNIQUE KEY `ga_token` (`ga_token`),
|
|
|
UNIQUE KEY `api_token` (`api_token`),
|
|
|
KEY `is_admin` (`is_admin`),
|
|
|
+ KEY `contact_method` (`contact_method`),
|
|
|
+ KEY `class` (`class`),
|
|
|
+ KEY `class_expire` (`class_expire`),
|
|
|
+ KEY `node_group` (`node_group`),
|
|
|
KEY `is_banned` (`is_banned`),
|
|
|
KEY `is_shadow_banned` (`is_shadow_banned`),
|
|
|
KEY `is_inactive` (`is_inactive`)
|
|
@@ -385,7 +389,6 @@ return new class() implements MigrationInterface {
|
|
|
`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`),
|
|
|
UNIQUE KEY `code` (`code`),
|
|
|
KEY `expire_time` (`expire_time`)
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
@@ -402,9 +405,9 @@ return new class() implements MigrationInterface {
|
|
|
CREATE TABLE `user_money_log` (
|
|
|
`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 '用户变动后账户余额',
|
|
|
- `amount` decimal(10,2) NOT NULL DEFAULT 0 COMMENT '变动总额',
|
|
|
+ `before` decimal(12,2) NOT NULL DEFAULT 0 COMMENT '用户变动前账户余额',
|
|
|
+ `after` decimal(12,2) NOT NULL DEFAULT 0 COMMENT '用户变动后账户余额',
|
|
|
+ `amount` decimal(12,2) NOT NULL DEFAULT 0 COMMENT '变动总额',
|
|
|
`remark` text NOT NULL DEFAULT '' COMMENT '备注',
|
|
|
`create_time` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
|
|
|
PRIMARY KEY (`id`),
|