install.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. -- Adminer 4.7.8 MySQL 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 DEFAULT NULL,
  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. `type` int(11) NOT NULL COMMENT '1新购2续费3升级',
  85. `cycle` varchar(255) NOT NULL,
  86. `trade_no` varchar(36) NOT NULL,
  87. `callback_no` varchar(255) DEFAULT NULL,
  88. `total_amount` int(11) NOT NULL,
  89. `discount_amount` int(11) DEFAULT NULL,
  90. `surplus_amount` int(11) DEFAULT NULL COMMENT '剩余价值',
  91. `refund_amount` int(11) DEFAULT NULL COMMENT '退款金额',
  92. `balance_amount` int(11) DEFAULT NULL COMMENT '使用余额',
  93. `surplus_order_ids` text DEFAULT NULL COMMENT '折抵订单',
  94. `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0待支付1开通中2已取消3已完成4已折抵',
  95. `commission_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0待确认1发放中2有效3无效',
  96. `commission_balance` int(11) NOT NULL DEFAULT 0,
  97. `created_at` int(11) NOT NULL,
  98. `updated_at` int(11) NOT NULL,
  99. PRIMARY KEY (`id`)
  100. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  101. DROP TABLE IF EXISTS `v2_plan`;
  102. CREATE TABLE `v2_plan` (
  103. `id` int(11) NOT NULL AUTO_INCREMENT,
  104. `group_id` int(11) NOT NULL,
  105. `transfer_enable` int(11) NOT NULL,
  106. `name` varchar(255) NOT NULL,
  107. `show` tinyint(1) NOT NULL DEFAULT 0,
  108. `sort` int(11) DEFAULT NULL,
  109. `renew` tinyint(1) NOT NULL DEFAULT 1,
  110. `content` text DEFAULT NULL,
  111. `month_price` int(11) DEFAULT NULL,
  112. `quarter_price` int(11) DEFAULT NULL,
  113. `half_year_price` int(11) DEFAULT NULL,
  114. `year_price` int(11) DEFAULT NULL,
  115. `two_year_price` int(11) DEFAULT NULL,
  116. `three_year_price` int(11) DEFAULT NULL,
  117. `onetime_price` int(11) DEFAULT NULL,
  118. `reset_price` int(11) DEFAULT NULL,
  119. `created_at` int(11) NOT NULL,
  120. `updated_at` int(11) NOT NULL,
  121. PRIMARY KEY (`id`)
  122. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  123. DROP TABLE IF EXISTS `v2_server`;
  124. CREATE TABLE `v2_server` (
  125. `id` int(11) NOT NULL AUTO_INCREMENT,
  126. `group_id` varchar(255) NOT NULL,
  127. `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  128. `parent_id` int(11) DEFAULT NULL,
  129. `host` varchar(255) NOT NULL,
  130. `port` int(11) NOT NULL,
  131. `server_port` int(11) NOT NULL,
  132. `tls` tinyint(4) NOT NULL DEFAULT 0,
  133. `tags` varchar(255) DEFAULT NULL,
  134. `rate` varchar(11) NOT NULL,
  135. `network` text NOT NULL,
  136. `alter_id` int(11) NOT NULL DEFAULT 1,
  137. `settings` text DEFAULT NULL,
  138. `rules` text DEFAULT NULL,
  139. `networkSettings` text DEFAULT NULL,
  140. `tlsSettings` text DEFAULT NULL,
  141. `ruleSettings` text DEFAULT NULL,
  142. `dnsSettings` text DEFAULT NULL,
  143. `show` tinyint(1) NOT NULL DEFAULT 0,
  144. `sort` int(11) DEFAULT NULL,
  145. `created_at` int(11) NOT NULL,
  146. `updated_at` int(11) NOT NULL,
  147. PRIMARY KEY (`id`)
  148. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  149. DROP TABLE IF EXISTS `v2_server_group`;
  150. CREATE TABLE `v2_server_group` (
  151. `id` int(11) NOT NULL AUTO_INCREMENT,
  152. `name` varchar(255) NOT NULL,
  153. `created_at` int(11) NOT NULL,
  154. `updated_at` int(11) NOT NULL,
  155. PRIMARY KEY (`id`)
  156. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  157. DROP TABLE IF EXISTS `v2_server_log`;
  158. CREATE TABLE `v2_server_log` (
  159. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  160. `user_id` int(11) NOT NULL,
  161. `server_id` int(11) NOT NULL,
  162. `u` varchar(255) NOT NULL,
  163. `d` varchar(255) NOT NULL,
  164. `rate` decimal(10,2) NOT NULL,
  165. `method` varchar(255) NOT NULL,
  166. `log_at` int(11) NOT NULL,
  167. `created_at` int(11) NOT NULL,
  168. `updated_at` int(11) NOT NULL,
  169. PRIMARY KEY (`id`),
  170. KEY `log_at` (`log_at`)
  171. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  172. DROP TABLE IF EXISTS `v2_server_shadowsocks`;
  173. CREATE TABLE `v2_server_shadowsocks` (
  174. `id` int(11) NOT NULL AUTO_INCREMENT,
  175. `group_id` varchar(255) NOT NULL,
  176. `parent_id` int(11) DEFAULT NULL,
  177. `tags` varchar(255) DEFAULT NULL,
  178. `name` varchar(255) NOT NULL,
  179. `rate` varchar(11) NOT NULL,
  180. `host` varchar(255) NOT NULL,
  181. `port` int(11) NOT NULL,
  182. `server_port` int(11) NOT NULL,
  183. `cipher` varchar(255) NOT NULL,
  184. `show` tinyint(4) NOT NULL DEFAULT 0,
  185. `sort` int(11) DEFAULT NULL,
  186. `created_at` int(11) NOT NULL,
  187. `updated_at` int(11) NOT NULL,
  188. PRIMARY KEY (`id`)
  189. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  190. DROP TABLE IF EXISTS `v2_server_trojan`;
  191. CREATE TABLE `v2_server_trojan` (
  192. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '节点ID',
  193. `group_id` varchar(255) NOT NULL COMMENT '节点组',
  194. `parent_id` int(11) DEFAULT NULL COMMENT '父节点',
  195. `tags` varchar(255) DEFAULT NULL COMMENT '节点标签',
  196. `name` varchar(255) NOT NULL COMMENT '节点名称',
  197. `rate` varchar(11) NOT NULL COMMENT '倍率',
  198. `host` varchar(255) NOT NULL COMMENT '主机名',
  199. `port` int(11) NOT NULL COMMENT '连接端口',
  200. `server_port` int(11) NOT NULL COMMENT '服务端口',
  201. `allow_insecure` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否允许不安全',
  202. `server_name` varchar(255) DEFAULT NULL,
  203. `show` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否显示',
  204. `sort` int(11) DEFAULT NULL,
  205. `created_at` int(11) NOT NULL,
  206. `updated_at` int(11) NOT NULL,
  207. PRIMARY KEY (`id`)
  208. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='trojan伺服器表';
  209. DROP TABLE IF EXISTS `v2_stat_order`;
  210. CREATE TABLE `v2_stat_order` (
  211. `id` int(11) NOT NULL AUTO_INCREMENT,
  212. `order_count` int(11) NOT NULL COMMENT '订单数量',
  213. `order_amount` int(11) NOT NULL COMMENT '订单合计',
  214. `commission_count` int(11) NOT NULL,
  215. `commission_amount` int(11) NOT NULL COMMENT '佣金合计',
  216. `record_type` char(1) NOT NULL,
  217. `record_at` int(11) NOT NULL,
  218. `created_at` int(11) NOT NULL,
  219. `updated_at` int(11) NOT NULL,
  220. PRIMARY KEY (`id`),
  221. UNIQUE KEY `record_at` (`record_at`)
  222. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单统计';
  223. DROP TABLE IF EXISTS `v2_stat_server`;
  224. CREATE TABLE `v2_stat_server` (
  225. `id` int(11) NOT NULL AUTO_INCREMENT,
  226. `server_id` int(11) NOT NULL COMMENT '节点id',
  227. `server_type` char(11) NOT NULL COMMENT '节点类型',
  228. `u` varchar(255) NOT NULL,
  229. `d` varchar(255) NOT NULL,
  230. `record_type` char(1) NOT NULL COMMENT 'd day m month',
  231. `record_at` int(11) NOT NULL COMMENT '记录时间',
  232. `created_at` int(11) NOT NULL,
  233. `updated_at` int(11) NOT NULL,
  234. PRIMARY KEY (`id`),
  235. UNIQUE KEY `server_id_server_type_record_at` (`server_id`,`server_type`,`record_at`),
  236. KEY `record_at` (`record_at`),
  237. KEY `server_id` (`server_id`)
  238. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='节点数据统计';
  239. DROP TABLE IF EXISTS `v2_ticket`;
  240. CREATE TABLE `v2_ticket` (
  241. `id` int(11) NOT NULL AUTO_INCREMENT,
  242. `user_id` int(11) NOT NULL,
  243. `last_reply_user_id` int(11) NOT NULL,
  244. `subject` varchar(255) NOT NULL,
  245. `level` tinyint(1) NOT NULL,
  246. `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0:已开启 1:已关闭',
  247. `created_at` int(11) NOT NULL,
  248. `updated_at` int(11) NOT NULL,
  249. PRIMARY KEY (`id`)
  250. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  251. DROP TABLE IF EXISTS `v2_ticket_message`;
  252. CREATE TABLE `v2_ticket_message` (
  253. `id` int(11) NOT NULL AUTO_INCREMENT,
  254. `user_id` int(11) NOT NULL,
  255. `ticket_id` int(11) NOT NULL,
  256. `message` varchar(255) NOT NULL,
  257. `created_at` int(11) NOT NULL,
  258. `updated_at` int(11) NOT NULL,
  259. PRIMARY KEY (`id`)
  260. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  261. DROP TABLE IF EXISTS `v2_user`;
  262. CREATE TABLE `v2_user` (
  263. `id` int(11) NOT NULL AUTO_INCREMENT,
  264. `invite_user_id` int(11) DEFAULT NULL,
  265. `telegram_id` bigint(20) DEFAULT NULL,
  266. `email` varchar(64) NOT NULL,
  267. `password` varchar(64) NOT NULL,
  268. `password_algo` char(10) DEFAULT NULL,
  269. `balance` int(11) NOT NULL DEFAULT 0,
  270. `discount` int(11) DEFAULT NULL,
  271. `commission_rate` int(11) DEFAULT NULL,
  272. `commission_balance` int(11) NOT NULL DEFAULT 0,
  273. `t` int(11) NOT NULL DEFAULT 0,
  274. `u` bigint(20) NOT NULL DEFAULT 0,
  275. `d` bigint(20) NOT NULL DEFAULT 0,
  276. `transfer_enable` bigint(20) NOT NULL DEFAULT 0,
  277. `banned` tinyint(1) NOT NULL DEFAULT 0,
  278. `is_admin` tinyint(1) NOT NULL DEFAULT 0,
  279. `is_staff` tinyint(1) NOT NULL DEFAULT 0,
  280. `last_login_at` int(11) DEFAULT NULL,
  281. `last_login_ip` int(11) DEFAULT NULL,
  282. `uuid` varchar(36) NOT NULL,
  283. `group_id` int(11) DEFAULT NULL,
  284. `plan_id` int(11) DEFAULT NULL,
  285. `remind_expire` tinyint(4) DEFAULT 1,
  286. `remind_traffic` tinyint(4) DEFAULT 1,
  287. `token` char(32) NOT NULL,
  288. `expired_at` bigint(20) DEFAULT 0,
  289. `created_at` int(11) NOT NULL,
  290. `updated_at` int(11) NOT NULL,
  291. PRIMARY KEY (`id`),
  292. UNIQUE KEY `email` (`email`)
  293. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  294. -- 2020-12-24 14:02:39