v2board/database/install.sql

263 lines
8.0 KiB
MySQL
Raw Normal View History

2020-04-26 12:24:26 +08:00
-- Adminer 4.7.3 MySQL dump
2019-10-29 15:33:36 +08:00
SET NAMES utf8;
2020-03-02 20:29:17 +08:00
SET time_zone = '+00:00';
2019-10-29 15:33:36 +08:00
SET foreign_key_checks = 0;
2020-03-02 20:29:17 +08:00
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
2019-10-29 15:33:36 +08:00
2019-12-31 17:49:24 +08:00
SET NAMES utf8mb4;
2020-02-13 13:43:55 +08:00
DROP TABLE IF EXISTS `failed_jobs`;
CREATE TABLE `failed_jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
2020-02-14 18:24:59 +08:00
2019-12-31 17:49:24 +08:00
DROP TABLE IF EXISTS `v2_coupon`;
CREATE TABLE `v2_coupon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
2020-01-01 15:59:53 +08:00
`code` char(8) NOT NULL,
2019-12-31 17:49:24 +08:00
`name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`type` tinyint(1) NOT NULL,
`value` int(11) NOT NULL,
2020-01-01 15:59:53 +08:00
`limit_use` int(11) DEFAULT NULL,
`started_at` int(11) NOT NULL,
`ended_at` int(11) NOT NULL,
2019-12-31 17:49:24 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2019-10-29 15:33:36 +08:00
DROP TABLE IF EXISTS `v2_invite_code`;
CREATE TABLE `v2_invite_code` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`code` char(32) NOT NULL,
2020-03-02 20:29:17 +08:00
`status` tinyint(1) NOT NULL DEFAULT '0',
`pv` int(11) NOT NULL DEFAULT '0',
2019-10-29 15:33:36 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2019-12-30 21:05:48 +08:00
DROP TABLE IF EXISTS `v2_mail_log`;
CREATE TABLE `v2_mail_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(64) NOT NULL,
`subject` varchar(255) NOT NULL,
`template_name` varchar(255) NOT NULL,
`error` varchar(255) DEFAULT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2019-12-12 13:45:46 +08:00
DROP TABLE IF EXISTS `v2_notice`;
CREATE TABLE `v2_notice` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
2019-12-13 17:07:46 +08:00
`img_url` varchar(255) DEFAULT NULL,
2019-12-12 13:45:46 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2019-10-29 15:33:36 +08:00
DROP TABLE IF EXISTS `v2_order`;
CREATE TABLE `v2_order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`invite_user_id` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`plan_id` int(11) NOT NULL,
2020-03-02 20:29:17 +08:00
`type` int(11) NOT NULL COMMENT '1新购2续费3升级',
2019-10-29 15:33:36 +08:00
`cycle` varchar(255) NOT NULL,
`trade_no` varchar(36) NOT NULL,
`callback_no` varchar(255) DEFAULT NULL,
`total_amount` int(11) NOT NULL,
2020-01-03 00:45:33 +08:00
`discount_amount` int(11) DEFAULT NULL,
2020-03-02 20:29:17 +08:00
`surplus_amount` int(11) DEFAULT NULL COMMENT '剩余价值',
`refund_amount` int(11) DEFAULT NULL COMMENT '退款金额',
2020-03-17 22:16:12 +08:00
`balance_amount` int(11) DEFAULT NULL COMMENT '使用余额',
2020-04-20 16:26:23 +08:00
`surplus_order_ids` text COMMENT '折抵订单',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0待支付1开通中2已取消3已完成4已折抵',
2020-03-02 20:29:17 +08:00
`commission_status` tinyint(1) NOT NULL DEFAULT '0',
`commission_balance` int(11) NOT NULL DEFAULT '0',
2019-10-29 15:33:36 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `v2_plan`;
CREATE TABLE `v2_plan` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL,
`transfer_enable` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
2020-03-02 20:29:17 +08:00
`show` tinyint(1) NOT NULL DEFAULT '0',
2020-04-20 16:26:23 +08:00
`sort` int(11) DEFAULT NULL,
2020-03-02 20:29:17 +08:00
`renew` tinyint(1) NOT NULL DEFAULT '1',
2019-10-29 15:33:36 +08:00
`content` text,
2020-04-26 12:24:26 +08:00
`month_price` int(11) DEFAULT NULL,
`quarter_price` int(11) DEFAULT NULL,
`half_year_price` int(11) DEFAULT NULL,
`year_price` int(11) DEFAULT NULL,
2020-02-28 15:06:30 +08:00
`onetime_price` int(11) DEFAULT NULL,
2020-04-26 12:24:26 +08:00
`reset_price` int(11) DEFAULT NULL,
2019-10-29 15:33:36 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `v2_server`;
CREATE TABLE `v2_server` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` varchar(255) NOT NULL,
2019-12-27 15:14:49 +08:00
`name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
2019-12-30 21:05:48 +08:00
`parent_id` int(11) DEFAULT NULL,
2019-10-29 15:33:36 +08:00
`host` varchar(255) NOT NULL,
`port` int(11) NOT NULL,
`server_port` int(11) NOT NULL,
2020-03-17 22:16:12 +08:00
`tls` tinyint(4) NOT NULL DEFAULT '0',
2019-11-04 19:56:22 +08:00
`tags` varchar(255) DEFAULT NULL,
2019-10-29 15:33:36 +08:00
`rate` varchar(11) NOT NULL,
2020-03-30 23:40:55 +08:00
`network` text NOT NULL,
2020-03-17 22:16:12 +08:00
`settings` text,
`rules` text,
2020-03-10 13:39:05 +08:00
`networkSettings` text,
`tlsSettings` text,
`ruleSettings` text,
2020-03-30 23:40:55 +08:00
`dnsSettings` text,
2020-03-02 20:29:17 +08:00
`show` tinyint(1) NOT NULL DEFAULT '0',
2020-04-20 16:26:23 +08:00
`sort` int(11) DEFAULT NULL,
2019-10-29 15:33:36 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `v2_server_group`;
CREATE TABLE `v2_server_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `v2_server_log`;
CREATE TABLE `v2_server_log` (
2020-04-26 12:24:26 +08:00
`id` bigint(20) NOT NULL AUTO_INCREMENT,
2019-10-29 15:33:36 +08:00
`user_id` int(11) NOT NULL,
2019-12-23 16:31:07 +08:00
`server_id` int(11) NOT NULL,
2019-10-29 15:33:36 +08:00
`u` varchar(255) NOT NULL,
`d` varchar(255) NOT NULL,
2020-01-20 16:47:53 +08:00
`rate` decimal(10,2) NOT NULL,
2020-05-11 17:19:58 +08:00
`log_at` int(11) NOT NULL,
2019-10-29 15:33:36 +08:00
`created_at` int(11) NOT NULL,
2020-04-26 12:24:26 +08:00
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
2019-10-29 15:33:36 +08:00
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2020-04-20 16:26:23 +08:00
DROP TABLE IF EXISTS `v2_server_stat`;
CREATE TABLE `v2_server_stat` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`server_id` int(11) NOT NULL,
`u` varchar(255) NOT NULL,
`d` varchar(25) NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
2020-04-26 12:24:26 +08:00
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2020-04-20 16:26:23 +08:00
2019-12-13 17:07:46 +08:00
DROP TABLE IF EXISTS `v2_ticket`;
CREATE TABLE `v2_ticket` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
2019-12-13 17:09:15 +08:00
`last_reply_user_id` int(11) NOT NULL,
2019-12-13 17:07:46 +08:00
`subject` varchar(255) NOT NULL,
`level` tinyint(1) NOT NULL,
2020-03-02 20:29:17 +08:00
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0:已开启 1:已关闭',
2019-12-13 17:07:46 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `v2_ticket_message`;
CREATE TABLE `v2_ticket_message` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`ticket_id` int(11) NOT NULL,
`message` varchar(255) NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2020-01-03 00:45:33 +08:00
DROP TABLE IF EXISTS `v2_tutorial`;
CREATE TABLE `v2_tutorial` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
2020-01-03 00:45:33 +08:00
`title` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`steps` text,
2020-03-02 20:29:17 +08:00
`show` tinyint(1) NOT NULL DEFAULT '0',
2020-04-20 16:26:23 +08:00
`sort` int(11) DEFAULT NULL,
2020-01-03 00:45:33 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2019-10-29 15:33:36 +08:00
DROP TABLE IF EXISTS `v2_user`;
CREATE TABLE `v2_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`invite_user_id` int(11) DEFAULT NULL,
`email` varchar(64) NOT NULL,
`password` varchar(64) NOT NULL,
2020-02-01 00:54:37 +08:00
`password_algo` char(10) DEFAULT NULL,
2020-03-02 20:29:17 +08:00
`balance` int(11) NOT NULL DEFAULT '0',
2020-02-14 18:24:59 +08:00
`discount` int(11) DEFAULT NULL,
2019-11-27 19:55:53 +08:00
`commission_rate` int(11) DEFAULT NULL,
2020-03-02 20:29:17 +08:00
`commission_balance` int(11) NOT NULL DEFAULT '0',
`t` int(11) NOT NULL DEFAULT '0',
`u` bigint(20) NOT NULL DEFAULT '0',
`d` bigint(20) NOT NULL DEFAULT '0',
`transfer_enable` bigint(20) NOT NULL DEFAULT '0',
`banned` tinyint(1) NOT NULL DEFAULT '0',
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
2019-12-19 22:22:31 +08:00
`last_login_at` int(11) DEFAULT NULL,
2019-10-29 15:33:36 +08:00
`last_login_ip` int(11) DEFAULT NULL,
`v2ray_uuid` varchar(36) NOT NULL,
2020-03-02 20:29:17 +08:00
`v2ray_alter_id` tinyint(4) NOT NULL DEFAULT '2',
`v2ray_level` tinyint(4) NOT NULL DEFAULT '0',
2019-10-29 15:33:36 +08:00
`group_id` int(11) DEFAULT NULL,
`plan_id` int(11) DEFAULT NULL,
2020-03-02 20:29:17 +08:00
`remind_expire` tinyint(4) DEFAULT '1',
`remind_traffic` tinyint(4) DEFAULT '1',
2019-10-29 15:33:36 +08:00
`token` char(32) NOT NULL,
2020-03-02 20:29:17 +08:00
`expired_at` bigint(20) DEFAULT '0',
2019-10-29 15:33:36 +08:00
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2020-04-26 12:24:26 +08:00
-- 2020-04-25 12:00:52