install.sql 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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=utf8mb4;
  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. `tags` varchar(255) DEFAULT NULL,
  90. `created_at` int(11) NOT NULL,
  91. `updated_at` int(11) NOT NULL,
  92. PRIMARY KEY (`id`)
  93. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  94. DROP TABLE IF EXISTS `v2_order`;
  95. CREATE TABLE `v2_order` (
  96. `id` int(11) NOT NULL AUTO_INCREMENT,
  97. `invite_user_id` int(11) DEFAULT NULL,
  98. `user_id` int(11) NOT NULL,
  99. `plan_id` int(11) NOT NULL,
  100. `coupon_id` int(11) DEFAULT NULL,
  101. `payment_id` int(11) DEFAULT NULL,
  102. `type` int(11) NOT NULL COMMENT '1新购2续费3升级',
  103. `period` varchar(255) NOT NULL,
  104. `trade_no` varchar(36) NOT NULL,
  105. `callback_no` varchar(255) DEFAULT NULL,
  106. `total_amount` int(11) NOT NULL,
  107. `handling_amount` int(11) DEFAULT NULL,
  108. `discount_amount` int(11) DEFAULT NULL,
  109. `surplus_amount` int(11) DEFAULT NULL COMMENT '剩余价值',
  110. `refund_amount` int(11) DEFAULT NULL COMMENT '退款金额',
  111. `balance_amount` int(11) DEFAULT NULL COMMENT '使用余额',
  112. `surplus_order_ids` text COMMENT '折抵订单',
  113. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0待支付1开通中2已取消3已完成4已折抵',
  114. `commission_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0待确认1发放中2有效3无效',
  115. `commission_balance` int(11) NOT NULL DEFAULT '0',
  116. `actual_commission_balance` int(11) DEFAULT NULL COMMENT '实际支付佣金',
  117. `paid_at` int(11) DEFAULT NULL,
  118. `created_at` int(11) NOT NULL,
  119. `updated_at` int(11) NOT NULL,
  120. PRIMARY KEY (`id`)
  121. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  122. DROP TABLE IF EXISTS `v2_payment`;
  123. CREATE TABLE `v2_payment` (
  124. `id` int(11) NOT NULL AUTO_INCREMENT,
  125. `uuid` char(32) NOT NULL,
  126. `payment` varchar(16) NOT NULL,
  127. `name` varchar(255) NOT NULL,
  128. `icon` varchar(255) DEFAULT NULL,
  129. `config` text NOT NULL,
  130. `notify_domain` varchar(128) DEFAULT NULL,
  131. `handling_fee_fixed` int(11) DEFAULT NULL,
  132. `handling_fee_percent` decimal(5,2) DEFAULT NULL,
  133. `enable` tinyint(1) NOT NULL DEFAULT '0',
  134. `sort` int(11) DEFAULT NULL,
  135. `created_at` int(11) NOT NULL,
  136. `updated_at` int(11) NOT NULL,
  137. PRIMARY KEY (`id`)
  138. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  139. DROP TABLE IF EXISTS `v2_plan`;
  140. CREATE TABLE `v2_plan` (
  141. `id` int(11) NOT NULL AUTO_INCREMENT,
  142. `group_id` int(11) NOT NULL,
  143. `transfer_enable` int(11) NOT NULL,
  144. `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  145. `show` tinyint(1) NOT NULL DEFAULT '0',
  146. `sort` int(11) DEFAULT NULL,
  147. `renew` tinyint(1) NOT NULL DEFAULT '1',
  148. `content` text CHARACTER SET utf8mb4,
  149. `month_price` int(11) DEFAULT NULL,
  150. `quarter_price` int(11) DEFAULT NULL,
  151. `half_year_price` int(11) DEFAULT NULL,
  152. `year_price` int(11) DEFAULT NULL,
  153. `two_year_price` int(11) DEFAULT NULL,
  154. `three_year_price` int(11) DEFAULT NULL,
  155. `onetime_price` int(11) DEFAULT NULL,
  156. `reset_price` int(11) DEFAULT NULL,
  157. `reset_traffic_method` tinyint(1) DEFAULT NULL,
  158. `capacity_limit` int(11) DEFAULT NULL,
  159. `created_at` int(11) NOT NULL,
  160. `updated_at` int(11) NOT NULL,
  161. PRIMARY KEY (`id`)
  162. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  163. DROP TABLE IF EXISTS `v2_server_group`;
  164. CREATE TABLE `v2_server_group` (
  165. `id` int(11) NOT NULL AUTO_INCREMENT,
  166. `name` varchar(255) NOT NULL,
  167. `created_at` int(11) NOT NULL,
  168. `updated_at` int(11) NOT NULL,
  169. PRIMARY KEY (`id`)
  170. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  171. DROP TABLE IF EXISTS `v2_server_shadowsocks`;
  172. CREATE TABLE `v2_server_shadowsocks` (
  173. `id` int(11) NOT NULL AUTO_INCREMENT,
  174. `group_id` varchar(255) NOT NULL,
  175. `parent_id` int(11) DEFAULT NULL,
  176. `tags` varchar(255) DEFAULT NULL,
  177. `name` varchar(255) NOT NULL,
  178. `rate` varchar(11) NOT NULL,
  179. `host` varchar(255) NOT NULL,
  180. `port` int(11) NOT NULL,
  181. `server_port` int(11) NOT NULL,
  182. `cipher` varchar(255) NOT NULL,
  183. `obfs` char(11) DEFAULT NULL,
  184. `obfs_settings` varchar(255) DEFAULT NULL,
  185. `show` tinyint(4) NOT NULL DEFAULT '0',
  186. `sort` int(11) DEFAULT NULL,
  187. `created_at` int(11) NOT NULL,
  188. `updated_at` int(11) NOT NULL,
  189. PRIMARY KEY (`id`)
  190. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  191. DROP TABLE IF EXISTS `v2_server_trojan`;
  192. CREATE TABLE `v2_server_trojan` (
  193. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '节点ID',
  194. `group_id` varchar(255) NOT NULL COMMENT '节点组',
  195. `parent_id` int(11) DEFAULT NULL COMMENT '父节点',
  196. `tags` varchar(255) DEFAULT NULL COMMENT '节点标签',
  197. `name` varchar(255) NOT NULL COMMENT '节点名称',
  198. `rate` varchar(11) NOT NULL COMMENT '倍率',
  199. `host` varchar(255) NOT NULL COMMENT '主机名',
  200. `port` int(11) NOT NULL COMMENT '连接端口',
  201. `server_port` int(11) NOT NULL COMMENT '服务端口',
  202. `allow_insecure` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否允许不安全',
  203. `server_name` varchar(255) DEFAULT NULL,
  204. `show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否显示',
  205. `sort` int(11) DEFAULT NULL,
  206. `created_at` int(11) NOT NULL,
  207. `updated_at` int(11) NOT NULL,
  208. PRIMARY KEY (`id`)
  209. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='trojan伺服器表';
  210. DROP TABLE IF EXISTS `v2_server_v2ray`;
  211. CREATE TABLE `v2_server_v2ray` (
  212. `id` int(11) NOT NULL AUTO_INCREMENT,
  213. `group_id` varchar(255) NOT NULL,
  214. `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  215. `parent_id` int(11) DEFAULT NULL,
  216. `host` varchar(255) NOT NULL,
  217. `port` char(11) NOT NULL,
  218. `server_port` int(11) NOT NULL,
  219. `tls` tinyint(4) NOT NULL DEFAULT '0',
  220. `tags` varchar(255) DEFAULT NULL,
  221. `rate` varchar(11) NOT NULL,
  222. `network` text NOT NULL,
  223. `rules` text,
  224. `networkSettings` text,
  225. `tlsSettings` text,
  226. `ruleSettings` text,
  227. `dnsSettings` text,
  228. `show` tinyint(1) NOT NULL DEFAULT '0',
  229. `sort` int(11) DEFAULT NULL,
  230. `created_at` int(11) NOT NULL,
  231. `updated_at` int(11) NOT NULL,
  232. PRIMARY KEY (`id`)
  233. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  234. DROP TABLE IF EXISTS `v2_stat_order`;
  235. CREATE TABLE `v2_stat_order` (
  236. `id` int(11) NOT NULL AUTO_INCREMENT,
  237. `order_count` int(11) NOT NULL COMMENT '订单数量',
  238. `order_amount` int(11) NOT NULL COMMENT '订单合计',
  239. `commission_count` int(11) NOT NULL,
  240. `commission_amount` int(11) NOT NULL COMMENT '佣金合计',
  241. `record_type` char(1) NOT NULL,
  242. `record_at` int(11) NOT NULL,
  243. `created_at` int(11) NOT NULL,
  244. `updated_at` int(11) NOT NULL,
  245. PRIMARY KEY (`id`),
  246. UNIQUE KEY `record_at` (`record_at`)
  247. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单统计';
  248. DROP TABLE IF EXISTS `v2_stat_server`;
  249. CREATE TABLE `v2_stat_server` (
  250. `id` int(11) NOT NULL AUTO_INCREMENT,
  251. `server_id` int(11) NOT NULL COMMENT '节点id',
  252. `server_type` char(11) NOT NULL COMMENT '节点类型',
  253. `u` bigint(20) NOT NULL,
  254. `d` bigint(20) NOT NULL,
  255. `record_type` char(1) NOT NULL COMMENT 'd day m month',
  256. `record_at` int(11) NOT NULL COMMENT '记录时间',
  257. `created_at` int(11) NOT NULL,
  258. `updated_at` int(11) NOT NULL,
  259. PRIMARY KEY (`id`),
  260. UNIQUE KEY `server_id_server_type_record_at` (`server_id`,`server_type`,`record_at`),
  261. KEY `record_at` (`record_at`),
  262. KEY `server_id` (`server_id`)
  263. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='节点数据统计';
  264. DROP TABLE IF EXISTS `v2_stat_user`;
  265. CREATE TABLE `v2_stat_user` (
  266. `id` int(11) NOT NULL AUTO_INCREMENT,
  267. `user_id` int(11) NOT NULL,
  268. `server_rate` decimal(10,2) NOT NULL,
  269. `u` bigint(20) NOT NULL,
  270. `d` bigint(20) NOT NULL,
  271. `record_type` char(2) NOT NULL,
  272. `record_at` int(11) NOT NULL,
  273. `created_at` int(11) NOT NULL,
  274. `updated_at` int(11) NOT NULL,
  275. PRIMARY KEY (`id`),
  276. UNIQUE KEY `server_rate_user_id_record_at` (`server_rate`,`user_id`,`record_at`),
  277. KEY `user_id` (`user_id`),
  278. KEY `record_at` (`record_at`),
  279. KEY `server_rate` (`server_rate`)
  280. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  281. DROP TABLE IF EXISTS `v2_ticket`;
  282. CREATE TABLE `v2_ticket` (
  283. `id` int(11) NOT NULL AUTO_INCREMENT,
  284. `user_id` int(11) NOT NULL,
  285. `subject` varchar(255) NOT NULL,
  286. `level` tinyint(1) NOT NULL,
  287. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0:已开启 1:已关闭',
  288. `reply_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0:待回复 1:已回复',
  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_ticket_message`;
  294. CREATE TABLE `v2_ticket_message` (
  295. `id` int(11) NOT NULL AUTO_INCREMENT,
  296. `user_id` int(11) NOT NULL,
  297. `ticket_id` int(11) NOT NULL,
  298. `message` text CHARACTER SET utf8mb4 NOT NULL,
  299. `created_at` int(11) NOT NULL,
  300. `updated_at` int(11) NOT NULL,
  301. PRIMARY KEY (`id`)
  302. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  303. DROP TABLE IF EXISTS `v2_user`;
  304. CREATE TABLE `v2_user` (
  305. `id` int(11) NOT NULL AUTO_INCREMENT,
  306. `invite_user_id` int(11) DEFAULT NULL,
  307. `telegram_id` bigint(20) DEFAULT NULL,
  308. `email` varchar(64) NOT NULL,
  309. `password` varchar(64) NOT NULL,
  310. `password_algo` char(10) DEFAULT NULL,
  311. `password_salt` char(10) DEFAULT NULL,
  312. `balance` int(11) NOT NULL DEFAULT '0',
  313. `discount` int(11) DEFAULT NULL,
  314. `commission_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: system 1: period 2: onetime',
  315. `commission_rate` int(11) DEFAULT NULL,
  316. `commission_balance` int(11) NOT NULL DEFAULT '0',
  317. `t` int(11) NOT NULL DEFAULT '0',
  318. `u` bigint(20) NOT NULL DEFAULT '0',
  319. `d` bigint(20) NOT NULL DEFAULT '0',
  320. `transfer_enable` bigint(20) NOT NULL DEFAULT '0',
  321. `banned` tinyint(1) NOT NULL DEFAULT '0',
  322. `is_admin` tinyint(1) NOT NULL DEFAULT '0',
  323. `is_staff` tinyint(1) NOT NULL DEFAULT '0',
  324. `last_login_at` int(11) DEFAULT NULL,
  325. `last_login_ip` int(11) DEFAULT NULL,
  326. `uuid` varchar(36) NOT NULL,
  327. `group_id` int(11) DEFAULT NULL,
  328. `plan_id` int(11) DEFAULT NULL,
  329. `remind_expire` tinyint(4) DEFAULT '1',
  330. `remind_traffic` tinyint(4) DEFAULT '1',
  331. `token` char(32) NOT NULL,
  332. `remarks` text,
  333. `expired_at` bigint(20) DEFAULT '0',
  334. `created_at` int(11) NOT NULL,
  335. `updated_at` int(11) NOT NULL,
  336. PRIMARY KEY (`id`),
  337. UNIQUE KEY `email` (`email`)
  338. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  339. -- 2022-07-07 18:23:17