install.sql 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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. `paid_at` int(11) DEFAULT NULL,
  99. `created_at` int(11) NOT NULL,
  100. `updated_at` int(11) NOT NULL,
  101. PRIMARY KEY (`id`)
  102. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  103. DROP TABLE IF EXISTS `v2_payment`;
  104. CREATE TABLE `v2_payment` (
  105. `id` int(11) NOT NULL AUTO_INCREMENT,
  106. `uuid` char(32) NOT NULL,
  107. `payment` varchar(16) NOT NULL,
  108. `name` varchar(255) NOT NULL,
  109. `config` text NOT NULL,
  110. `enable` tinyint(1) NOT NULL DEFAULT '0',
  111. `sort` 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=utf8mb4;
  116. DROP TABLE IF EXISTS `v2_plan`;
  117. CREATE TABLE `v2_plan` (
  118. `id` int(11) NOT NULL AUTO_INCREMENT,
  119. `group_id` int(11) NOT NULL,
  120. `transfer_enable` int(11) NOT NULL,
  121. `name` varchar(255) NOT NULL,
  122. `show` tinyint(1) NOT NULL DEFAULT '0',
  123. `sort` int(11) DEFAULT NULL,
  124. `renew` tinyint(1) NOT NULL DEFAULT '1',
  125. `content` text,
  126. `month_price` int(11) DEFAULT NULL,
  127. `quarter_price` int(11) DEFAULT NULL,
  128. `half_year_price` int(11) DEFAULT NULL,
  129. `year_price` int(11) DEFAULT NULL,
  130. `two_year_price` int(11) DEFAULT NULL,
  131. `three_year_price` int(11) DEFAULT NULL,
  132. `onetime_price` int(11) DEFAULT NULL,
  133. `reset_price` int(11) DEFAULT NULL,
  134. `created_at` int(11) NOT NULL,
  135. `updated_at` int(11) NOT NULL,
  136. PRIMARY KEY (`id`)
  137. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  138. DROP TABLE IF EXISTS `v2_server`;
  139. CREATE TABLE `v2_server` (
  140. `id` int(11) NOT NULL AUTO_INCREMENT,
  141. `group_id` varchar(255) NOT NULL,
  142. `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  143. `parent_id` int(11) DEFAULT NULL,
  144. `host` varchar(255) NOT NULL,
  145. `port` int(11) NOT NULL,
  146. `server_port` int(11) NOT NULL,
  147. `tls` tinyint(4) NOT NULL DEFAULT '0',
  148. `tags` varchar(255) DEFAULT NULL,
  149. `rate` varchar(11) NOT NULL,
  150. `network` text NOT NULL,
  151. `alter_id` int(11) NOT NULL DEFAULT '1',
  152. `settings` text,
  153. `rules` text,
  154. `networkSettings` text,
  155. `tlsSettings` text,
  156. `ruleSettings` text,
  157. `dnsSettings` text,
  158. `show` tinyint(1) NOT NULL DEFAULT '0',
  159. `sort` int(11) DEFAULT NULL,
  160. `created_at` int(11) NOT NULL,
  161. `updated_at` int(11) NOT NULL,
  162. PRIMARY KEY (`id`)
  163. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  164. DROP TABLE IF EXISTS `v2_server_group`;
  165. CREATE TABLE `v2_server_group` (
  166. `id` int(11) NOT NULL AUTO_INCREMENT,
  167. `name` varchar(255) NOT NULL,
  168. `created_at` int(11) NOT NULL,
  169. `updated_at` int(11) NOT NULL,
  170. PRIMARY KEY (`id`)
  171. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  172. DROP TABLE IF EXISTS `v2_server_log`;
  173. CREATE TABLE `v2_server_log` (
  174. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  175. `user_id` int(11) NOT NULL,
  176. `server_id` int(11) NOT NULL,
  177. `u` varchar(255) NOT NULL,
  178. `d` varchar(255) NOT NULL,
  179. `rate` decimal(10,2) NOT NULL,
  180. `method` varchar(255) NOT NULL,
  181. `log_at` int(11) NOT NULL,
  182. `created_at` int(11) NOT NULL,
  183. `updated_at` int(11) NOT NULL,
  184. PRIMARY KEY (`id`),
  185. KEY `log_at` (`log_at`)
  186. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  187. DROP TABLE IF EXISTS `v2_server_shadowsocks`;
  188. CREATE TABLE `v2_server_shadowsocks` (
  189. `id` int(11) NOT NULL AUTO_INCREMENT,
  190. `group_id` varchar(255) NOT NULL,
  191. `parent_id` int(11) DEFAULT NULL,
  192. `tags` varchar(255) DEFAULT NULL,
  193. `name` varchar(255) NOT NULL,
  194. `rate` varchar(11) NOT NULL,
  195. `host` varchar(255) NOT NULL,
  196. `port` int(11) NOT NULL,
  197. `server_port` int(11) NOT NULL,
  198. `cipher` varchar(255) NOT NULL,
  199. `show` tinyint(4) NOT NULL DEFAULT '0',
  200. `sort` int(11) DEFAULT NULL,
  201. `created_at` int(11) NOT NULL,
  202. `updated_at` int(11) NOT NULL,
  203. PRIMARY KEY (`id`)
  204. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  205. DROP TABLE IF EXISTS `v2_server_trojan`;
  206. CREATE TABLE `v2_server_trojan` (
  207. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '节点ID',
  208. `group_id` varchar(255) NOT NULL COMMENT '节点组',
  209. `parent_id` int(11) DEFAULT NULL COMMENT '父节点',
  210. `tags` varchar(255) DEFAULT NULL COMMENT '节点标签',
  211. `name` varchar(255) NOT NULL COMMENT '节点名称',
  212. `rate` varchar(11) NOT NULL COMMENT '倍率',
  213. `host` varchar(255) NOT NULL COMMENT '主机名',
  214. `port` int(11) NOT NULL COMMENT '连接端口',
  215. `server_port` int(11) NOT NULL COMMENT '服务端口',
  216. `allow_insecure` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否允许不安全',
  217. `server_name` varchar(255) DEFAULT NULL,
  218. `show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否显示',
  219. `sort` int(11) DEFAULT NULL,
  220. `created_at` int(11) NOT NULL,
  221. `updated_at` int(11) NOT NULL,
  222. PRIMARY KEY (`id`)
  223. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='trojan伺服器表';
  224. DROP TABLE IF EXISTS `v2_stat_order`;
  225. CREATE TABLE `v2_stat_order` (
  226. `id` int(11) NOT NULL AUTO_INCREMENT,
  227. `order_count` int(11) NOT NULL COMMENT '订单数量',
  228. `order_amount` int(11) NOT NULL COMMENT '订单合计',
  229. `commission_count` int(11) NOT NULL,
  230. `commission_amount` int(11) NOT NULL COMMENT '佣金合计',
  231. `record_type` char(1) NOT NULL,
  232. `record_at` int(11) NOT NULL,
  233. `created_at` int(11) NOT NULL,
  234. `updated_at` int(11) NOT NULL,
  235. PRIMARY KEY (`id`),
  236. UNIQUE KEY `record_at` (`record_at`)
  237. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单统计';
  238. DROP TABLE IF EXISTS `v2_stat_server`;
  239. CREATE TABLE `v2_stat_server` (
  240. `id` int(11) NOT NULL AUTO_INCREMENT,
  241. `server_id` int(11) NOT NULL COMMENT '节点id',
  242. `server_type` char(11) NOT NULL COMMENT '节点类型',
  243. `u` varchar(255) NOT NULL,
  244. `d` varchar(255) NOT NULL,
  245. `record_type` char(1) NOT NULL COMMENT 'd day m month',
  246. `record_at` int(11) NOT NULL COMMENT '记录时间',
  247. `created_at` int(11) NOT NULL,
  248. `updated_at` int(11) NOT NULL,
  249. PRIMARY KEY (`id`),
  250. UNIQUE KEY `server_id_server_type_record_at` (`server_id`,`server_type`,`record_at`),
  251. KEY `record_at` (`record_at`),
  252. KEY `server_id` (`server_id`)
  253. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='节点数据统计';
  254. DROP TABLE IF EXISTS `v2_ticket`;
  255. CREATE TABLE `v2_ticket` (
  256. `id` int(11) NOT NULL AUTO_INCREMENT,
  257. `user_id` int(11) NOT NULL,
  258. `last_reply_user_id` int(11) NOT NULL,
  259. `subject` varchar(255) NOT NULL,
  260. `level` tinyint(1) NOT NULL,
  261. `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0:已开启 1:已关闭',
  262. `created_at` int(11) NOT NULL,
  263. `updated_at` int(11) NOT NULL,
  264. PRIMARY KEY (`id`)
  265. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  266. DROP TABLE IF EXISTS `v2_ticket_message`;
  267. CREATE TABLE `v2_ticket_message` (
  268. `id` int(11) NOT NULL AUTO_INCREMENT,
  269. `user_id` int(11) NOT NULL,
  270. `ticket_id` int(11) NOT NULL,
  271. `message` varchar(255) NOT NULL,
  272. `created_at` int(11) NOT NULL,
  273. `updated_at` int(11) NOT NULL,
  274. PRIMARY KEY (`id`)
  275. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  276. DROP TABLE IF EXISTS `v2_user`;
  277. CREATE TABLE `v2_user` (
  278. `id` int(11) NOT NULL AUTO_INCREMENT,
  279. `invite_user_id` int(11) DEFAULT NULL,
  280. `telegram_id` bigint(20) DEFAULT NULL,
  281. `email` varchar(64) NOT NULL,
  282. `password` varchar(64) NOT NULL,
  283. `password_algo` char(10) DEFAULT NULL,
  284. `balance` int(11) NOT NULL DEFAULT '0',
  285. `discount` int(11) DEFAULT NULL,
  286. `commission_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: system 1: cycle 2: onetime',
  287. `commission_rate` int(11) DEFAULT NULL,
  288. `commission_balance` int(11) NOT NULL DEFAULT '0',
  289. `t` int(11) NOT NULL DEFAULT '0',
  290. `u` bigint(20) NOT NULL DEFAULT '0',
  291. `d` bigint(20) NOT NULL DEFAULT '0',
  292. `transfer_enable` bigint(20) NOT NULL DEFAULT '0',
  293. `banned` tinyint(1) NOT NULL DEFAULT '0',
  294. `is_admin` tinyint(1) NOT NULL DEFAULT '0',
  295. `is_staff` tinyint(1) NOT NULL DEFAULT '0',
  296. `last_login_at` int(11) DEFAULT NULL,
  297. `last_login_ip` int(11) DEFAULT NULL,
  298. `uuid` varchar(36) NOT NULL,
  299. `group_id` int(11) DEFAULT NULL,
  300. `plan_id` int(11) DEFAULT NULL,
  301. `remind_expire` tinyint(4) DEFAULT '1',
  302. `remind_traffic` tinyint(4) DEFAULT '1',
  303. `token` char(32) NOT NULL,
  304. `remarks` text,
  305. `expired_at` bigint(20) DEFAULT '0',
  306. `created_at` int(11) NOT NULL,
  307. `updated_at` int(11) NOT NULL,
  308. PRIMARY KEY (`id`),
  309. UNIQUE KEY `email` (`email`)
  310. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  311. -- 2021-07-30 17:19:01