install.sql 20 KB

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