install.sql 21 KB

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