install.sql 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. -- Adminer 4.8.0 MySQL 5.7.29 dump
  2. SET NAMES utf8;
  3. SET time_zone = '+00:00';
  4. SET foreign_key_checks = 0;
  5. SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
  6. SET NAMES utf8mb4;
  7. DROP TABLE IF EXISTS `failed_jobs`;
  8. CREATE TABLE `failed_jobs` (
  9. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  10. `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  11. `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  12. `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  13. `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  14. `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  15. PRIMARY KEY (`id`)
  16. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  17. DROP TABLE IF EXISTS `v2_coupon`;
  18. CREATE TABLE `v2_coupon` (
  19. `id` int(11) NOT NULL AUTO_INCREMENT,
  20. `code` varchar(255) NOT NULL,
  21. `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  22. `type` tinyint(1) NOT NULL,
  23. `value` int(11) NOT NULL,
  24. `limit_use` int(11) DEFAULT NULL,
  25. `limit_plan_ids` varchar(255) DEFAULT NULL,
  26. `started_at` int(11) NOT NULL,
  27. `ended_at` int(11) NOT NULL,
  28. `created_at` int(11) NOT NULL,
  29. `updated_at` int(11) NOT NULL,
  30. PRIMARY KEY (`id`)
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  32. DROP TABLE IF EXISTS `v2_invite_code`;
  33. CREATE TABLE `v2_invite_code` (
  34. `id` int(11) NOT NULL AUTO_INCREMENT,
  35. `user_id` int(11) NOT NULL,
  36. `code` char(32) NOT NULL,
  37. `status` tinyint(1) NOT NULL DEFAULT '0',
  38. `pv` int(11) NOT NULL DEFAULT '0',
  39. `created_at` int(11) NOT NULL,
  40. `updated_at` int(11) NOT NULL,
  41. PRIMARY KEY (`id`)
  42. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  43. DROP TABLE IF EXISTS `v2_knowledge`;
  44. CREATE TABLE `v2_knowledge` (
  45. `id` int(11) NOT NULL AUTO_INCREMENT,
  46. `language` char(5) NOT NULL COMMENT '語言',
  47. `category` varchar(255) NOT NULL COMMENT '分類名',
  48. `title` varchar(255) NOT NULL COMMENT '標題',
  49. `body` text NOT NULL COMMENT '內容',
  50. `sort` int(11) DEFAULT NULL COMMENT '排序',
  51. `show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '顯示',
  52. `created_at` int(11) NOT NULL COMMENT '創建時間',
  53. `updated_at` int(11) NOT NULL COMMENT '更新時間',
  54. PRIMARY KEY (`id`)
  55. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='知識庫';
  56. DROP TABLE IF EXISTS `v2_mail_log`;
  57. CREATE TABLE `v2_mail_log` (
  58. `id` int(11) NOT NULL AUTO_INCREMENT,
  59. `email` varchar(64) NOT NULL,
  60. `subject` varchar(255) NOT NULL,
  61. `template_name` varchar(255) NOT NULL,
  62. `error` text,
  63. `created_at` int(11) NOT NULL,
  64. `updated_at` int(11) NOT NULL,
  65. PRIMARY KEY (`id`)
  66. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  67. DROP TABLE IF EXISTS `v2_notice`;
  68. CREATE TABLE `v2_notice` (
  69. `id` int(11) NOT NULL AUTO_INCREMENT,
  70. `title` varchar(255) NOT NULL,
  71. `content` text NOT NULL,
  72. `img_url` varchar(255) DEFAULT NULL,
  73. `created_at` int(11) NOT NULL,
  74. `updated_at` int(11) NOT NULL,
  75. PRIMARY KEY (`id`)
  76. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  77. DROP TABLE IF EXISTS `v2_order`;
  78. CREATE TABLE `v2_order` (
  79. `id` int(11) NOT NULL AUTO_INCREMENT,
  80. `invite_user_id` int(11) DEFAULT NULL,
  81. `user_id` int(11) NOT NULL,
  82. `plan_id` int(11) NOT NULL,
  83. `coupon_id` int(11) DEFAULT NULL,
  84. `payment_id` int(11) DEFAULT NULL,
  85. `type` int(11) NOT NULL COMMENT '1新购2续费3升级',
  86. `cycle` varchar(255) NOT NULL,
  87. `trade_no` varchar(36) NOT NULL,
  88. `callback_no` varchar(255) DEFAULT NULL,
  89. `total_amount` int(11) NOT NULL,
  90. `discount_amount` int(11) DEFAULT NULL,
  91. `surplus_amount` int(11) DEFAULT NULL COMMENT '剩余价值',
  92. `refund_amount` int(11) DEFAULT NULL COMMENT '退款金额',
  93. `balance_amount` int(11) DEFAULT NULL COMMENT '使用余额',
  94. `surplus_order_ids` text COMMENT '折抵订单',
  95. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0待支付1开通中2已取消3已完成4已折抵',
  96. `commission_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0待确认1发放中2有效3无效',
  97. `commission_balance` int(11) NOT NULL DEFAULT '0',
  98. `created_at` int(11) NOT NULL,
  99. `updated_at` int(11) NOT NULL,
  100. PRIMARY KEY (`id`)
  101. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  102. DROP TABLE IF EXISTS `v2_payment`;
  103. CREATE TABLE `v2_payment` (
  104. `id` int(11) NOT NULL AUTO_INCREMENT,
  105. `payment` varchar(16) NOT NULL,
  106. `name` varchar(255) NOT NULL,
  107. `config` text NOT NULL,
  108. `enable` tinyint(1) NOT NULL DEFAULT '0',
  109. `sort` int(11) DEFAULT NULL,
  110. `created_at` int(11) NOT NULL,
  111. `updated_at` int(11) NOT NULL,
  112. PRIMARY KEY (`id`)
  113. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  114. DROP TABLE IF EXISTS `v2_plan`;
  115. CREATE TABLE `v2_plan` (
  116. `id` int(11) NOT NULL AUTO_INCREMENT,
  117. `group_id` int(11) NOT NULL,
  118. `transfer_enable` int(11) NOT NULL,
  119. `name` varchar(255) NOT NULL,
  120. `show` tinyint(1) NOT NULL DEFAULT '0',
  121. `sort` int(11) DEFAULT NULL,
  122. `renew` tinyint(1) NOT NULL DEFAULT '1',
  123. `content` text,
  124. `month_price` int(11) DEFAULT NULL,
  125. `quarter_price` int(11) DEFAULT NULL,
  126. `half_year_price` int(11) DEFAULT NULL,
  127. `year_price` int(11) DEFAULT NULL,
  128. `two_year_price` int(11) DEFAULT NULL,
  129. `three_year_price` int(11) DEFAULT NULL,
  130. `onetime_price` int(11) DEFAULT NULL,
  131. `reset_price` int(11) DEFAULT NULL,
  132. `created_at` int(11) NOT NULL,
  133. `updated_at` int(11) NOT NULL,
  134. PRIMARY KEY (`id`)
  135. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  136. DROP TABLE IF EXISTS `v2_server`;
  137. CREATE TABLE `v2_server` (
  138. `id` int(11) NOT NULL AUTO_INCREMENT,
  139. `group_id` varchar(255) NOT NULL,
  140. `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  141. `parent_id` int(11) DEFAULT NULL,
  142. `host` varchar(255) NOT NULL,
  143. `port` int(11) NOT NULL,
  144. `server_port` int(11) NOT NULL,
  145. `tls` tinyint(4) NOT NULL DEFAULT '0',
  146. `tags` varchar(255) DEFAULT NULL,
  147. `rate` varchar(11) NOT NULL,
  148. `network` text NOT NULL,
  149. `alter_id` int(11) NOT NULL DEFAULT '1',
  150. `settings` text,
  151. `rules` text,
  152. `networkSettings` text,
  153. `tlsSettings` text,
  154. `ruleSettings` text,
  155. `dnsSettings` text,
  156. `show` tinyint(1) NOT NULL DEFAULT '0',
  157. `sort` int(11) DEFAULT NULL,
  158. `created_at` int(11) NOT NULL,
  159. `updated_at` int(11) NOT NULL,
  160. PRIMARY KEY (`id`)
  161. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  162. DROP TABLE IF EXISTS `v2_server_group`;
  163. CREATE TABLE `v2_server_group` (
  164. `id` int(11) NOT NULL AUTO_INCREMENT,
  165. `name` varchar(255) NOT NULL,
  166. `created_at` int(11) NOT NULL,
  167. `updated_at` int(11) NOT NULL,
  168. PRIMARY KEY (`id`)
  169. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  170. DROP TABLE IF EXISTS `v2_server_log`;
  171. CREATE TABLE `v2_server_log` (
  172. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  173. `user_id` int(11) NOT NULL,
  174. `server_id` int(11) NOT NULL,
  175. `u` varchar(255) NOT NULL,
  176. `d` varchar(255) NOT NULL,
  177. `rate` decimal(10,2) NOT NULL,
  178. `method` varchar(255) NOT NULL,
  179. `log_at` int(11) NOT NULL,
  180. `created_at` int(11) NOT NULL,
  181. `updated_at` int(11) NOT NULL,
  182. PRIMARY KEY (`id`),
  183. KEY `log_at` (`log_at`)
  184. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  185. DROP TABLE IF EXISTS `v2_server_shadowsocks`;
  186. CREATE TABLE `v2_server_shadowsocks` (
  187. `id` int(11) NOT NULL AUTO_INCREMENT,
  188. `group_id` varchar(255) NOT NULL,
  189. `parent_id` int(11) DEFAULT NULL,
  190. `tags` varchar(255) DEFAULT NULL,
  191. `name` varchar(255) NOT NULL,
  192. `rate` varchar(11) NOT NULL,
  193. `host` varchar(255) NOT NULL,
  194. `port` int(11) NOT NULL,
  195. `server_port` int(11) NOT NULL,
  196. `cipher` varchar(255) NOT NULL,
  197. `show` tinyint(4) NOT NULL DEFAULT '0',
  198. `sort` int(11) DEFAULT NULL,
  199. `created_at` int(11) NOT NULL,
  200. `updated_at` int(11) NOT NULL,
  201. PRIMARY KEY (`id`)
  202. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  203. DROP TABLE IF EXISTS `v2_server_trojan`;
  204. CREATE TABLE `v2_server_trojan` (
  205. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '节点ID',
  206. `group_id` varchar(255) NOT NULL COMMENT '节点组',
  207. `parent_id` int(11) DEFAULT NULL COMMENT '父节点',
  208. `tags` varchar(255) DEFAULT NULL COMMENT '节点标签',
  209. `name` varchar(255) NOT NULL COMMENT '节点名称',
  210. `rate` varchar(11) NOT NULL COMMENT '倍率',
  211. `host` varchar(255) NOT NULL COMMENT '主机名',
  212. `port` int(11) NOT NULL COMMENT '连接端口',
  213. `server_port` int(11) NOT NULL COMMENT '服务端口',
  214. `allow_insecure` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否允许不安全',
  215. `server_name` varchar(255) DEFAULT NULL,
  216. `show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否显示',
  217. `sort` int(11) DEFAULT NULL,
  218. `created_at` int(11) NOT NULL,
  219. `updated_at` int(11) NOT NULL,
  220. PRIMARY KEY (`id`)
  221. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='trojan伺服器表';
  222. DROP TABLE IF EXISTS `v2_stat_order`;
  223. CREATE TABLE `v2_stat_order` (
  224. `id` int(11) NOT NULL AUTO_INCREMENT,
  225. `order_count` int(11) NOT NULL COMMENT '订单数量',
  226. `order_amount` int(11) NOT NULL COMMENT '订单合计',
  227. `commission_count` int(11) NOT NULL,
  228. `commission_amount` int(11) NOT NULL COMMENT '佣金合计',
  229. `record_type` char(1) NOT NULL,
  230. `record_at` int(11) NOT NULL,
  231. `created_at` int(11) NOT NULL,
  232. `updated_at` int(11) NOT NULL,
  233. PRIMARY KEY (`id`),
  234. UNIQUE KEY `record_at` (`record_at`)
  235. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单统计';
  236. DROP TABLE IF EXISTS `v2_stat_server`;
  237. CREATE TABLE `v2_stat_server` (
  238. `id` int(11) NOT NULL AUTO_INCREMENT,
  239. `server_id` int(11) NOT NULL COMMENT '节点id',
  240. `server_type` char(11) NOT NULL COMMENT '节点类型',
  241. `u` varchar(255) NOT NULL,
  242. `d` varchar(255) NOT NULL,
  243. `record_type` char(1) NOT NULL COMMENT 'd day m month',
  244. `record_at` int(11) NOT NULL COMMENT '记录时间',
  245. `created_at` int(11) NOT NULL,
  246. `updated_at` int(11) NOT NULL,
  247. PRIMARY KEY (`id`),
  248. UNIQUE KEY `server_id_server_type_record_at` (`server_id`,`server_type`,`record_at`),
  249. KEY `record_at` (`record_at`),
  250. KEY `server_id` (`server_id`)
  251. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='节点数据统计';
  252. DROP TABLE IF EXISTS `v2_ticket`;
  253. CREATE TABLE `v2_ticket` (
  254. `id` int(11) NOT NULL AUTO_INCREMENT,
  255. `user_id` int(11) NOT NULL,
  256. `last_reply_user_id` int(11) NOT NULL,
  257. `subject` varchar(255) NOT NULL,
  258. `level` tinyint(1) NOT NULL,
  259. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0:已开启 1:已关闭',
  260. `created_at` int(11) NOT NULL,
  261. `updated_at` int(11) NOT NULL,
  262. PRIMARY KEY (`id`)
  263. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  264. DROP TABLE IF EXISTS `v2_ticket_message`;
  265. CREATE TABLE `v2_ticket_message` (
  266. `id` int(11) NOT NULL AUTO_INCREMENT,
  267. `user_id` int(11) NOT NULL,
  268. `ticket_id` int(11) NOT NULL,
  269. `message` varchar(255) NOT NULL,
  270. `created_at` int(11) NOT NULL,
  271. `updated_at` int(11) NOT NULL,
  272. PRIMARY KEY (`id`)
  273. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  274. DROP TABLE IF EXISTS `v2_user`;
  275. CREATE TABLE `v2_user` (
  276. `id` int(11) NOT NULL AUTO_INCREMENT,
  277. `invite_user_id` int(11) DEFAULT NULL,
  278. `telegram_id` bigint(20) DEFAULT NULL,
  279. `email` varchar(64) NOT NULL,
  280. `password` varchar(64) NOT NULL,
  281. `password_algo` char(10) DEFAULT NULL,
  282. `balance` int(11) NOT NULL DEFAULT '0',
  283. `discount` int(11) DEFAULT NULL,
  284. `commission_rate` int(11) DEFAULT NULL,
  285. `commission_balance` int(11) NOT NULL DEFAULT '0',
  286. `t` int(11) NOT NULL DEFAULT '0',
  287. `u` bigint(20) NOT NULL DEFAULT '0',
  288. `d` bigint(20) NOT NULL DEFAULT '0',
  289. `transfer_enable` bigint(20) NOT NULL DEFAULT '0',
  290. `banned` tinyint(1) NOT NULL DEFAULT '0',
  291. `is_admin` tinyint(1) NOT NULL DEFAULT '0',
  292. `is_staff` tinyint(1) NOT NULL DEFAULT '0',
  293. `last_login_at` int(11) DEFAULT NULL,
  294. `last_login_ip` int(11) DEFAULT NULL,
  295. `uuid` varchar(36) NOT NULL,
  296. `group_id` int(11) DEFAULT NULL,
  297. `plan_id` int(11) DEFAULT NULL,
  298. `remind_expire` tinyint(4) DEFAULT '1',
  299. `remind_traffic` tinyint(4) DEFAULT '1',
  300. `token` char(32) NOT NULL,
  301. `remarks` text,
  302. `expired_at` bigint(20) DEFAULT '0',
  303. `created_at` int(11) NOT NULL,
  304. `updated_at` int(11) NOT NULL,
  305. PRIMARY KEY (`id`),
  306. UNIQUE KEY `email` (`email`)
  307. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  308. -- 2021-04-28 08:53:45