install.sql 20 KB

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