2020_08_21_145711_create_ss_node_table.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateSsNodeTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('ss_node', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->boolean('type')->default(1)->comment('服务类型:1-Shadowsocks(R)、2-V2ray、3-Trojan、4-VNet');
  17. $table->string('name', 128)->comment('名称');
  18. $table->char('country_code', 5)->default('un')->comment('国家代码');
  19. $table->string('server')->nullable()->comment('服务器域名地址');
  20. $table->ipAddress('ip')->nullable()->comment('服务器IPV4地址');
  21. $table->ipAddress('ipv6')->nullable()->comment('服务器IPV6地址');
  22. $table->unsignedTinyInteger('level')->default(0)->comment('等级:0-无等级,全部可见');
  23. $table->unsignedBigInteger('speed_limit')->default(0)->comment('节点限速,为0表示不限速,单位Byte');
  24. $table->unsignedSmallInteger('client_limit')->default(0)->comment('设备数限制');
  25. $table->string('relay_server')->nullable()->comment('中转地址');
  26. $table->unsignedSmallInteger('relay_port')->nullable()->comment('中转端口');
  27. $table->string('description')->nullable()->comment('节点简单描述');
  28. $table->string('geo')->nullable()->comment('节点地理位置');
  29. $table->string('method', 32)->default('aes-256-cfb')->comment('加密方式');
  30. $table->string('protocol', 64)->default('origin')->comment('协议');
  31. $table->string('protocol_param', 128)->nullable()->comment('协议参数');
  32. $table->string('obfs', 64)->default('plain')->comment('混淆');
  33. $table->string('obfs_param')->nullable()->comment('混淆参数');
  34. $table->float('traffic_rate', 6)->unsigned()->default(1.00)->comment('流量比率');
  35. $table->boolean('is_subscribe')->default(1)->index()->comment('是否允许用户订阅该节点:0-否、1-是');
  36. $table->boolean('is_ddns')->default(0)->comment('是否使用DDNS:0-否、1-是');
  37. $table->boolean('is_relay')->default(0)->comment('是否中转节点:0-否、1-是');
  38. $table->boolean('is_udp')->default(1)->comment('是否启用UDP:0-不启用、1-启用');
  39. $table->unsignedSmallInteger('push_port')->default(1000)->comment('消息推送端口');
  40. $table->boolean('detection_type')->default(1)->comment('节点检测: 0-关闭、1-只检测TCP、2-只检测ICMP、3-检测全部');
  41. $table->boolean('compatible')->default(0)->comment('兼容SS');
  42. $table->boolean('single')->default(0)->comment('启用单端口功能:0-否、1-是');
  43. $table->unsignedSmallInteger('port')->nullable()->comment('单端口的端口号或连接端口号');
  44. $table->string('passwd')->nullable()->comment('单端口的连接密码');
  45. $table->unsignedTinyInteger('sort')->default(0)->comment('排序值,值越大越靠前显示');
  46. $table->boolean('status')->default(1)->comment('状态:0-维护、1-正常');
  47. $table->unsignedSmallInteger('v2_alter_id')->default(16)->comment('V2Ray额外ID');
  48. $table->unsignedSmallInteger('v2_port')->default(0)->comment('V2Ray服务端口');
  49. $table->string('v2_method', 32)->default('aes-128-gcm')->comment('V2Ray加密方式');
  50. $table->string('v2_net', 16)->default('tcp')->comment('V2Ray传输协议');
  51. $table->string('v2_type', 32)->default('none')->comment('V2Ray伪装类型');
  52. $table->string('v2_host')->nullable()->comment('V2Ray伪装的域名');
  53. $table->string('v2_path')->nullable()->comment('V2Ray的WS/H2路径');
  54. $table->boolean('v2_tls')->default(0)->comment('V2Ray连接TLS:0-未开启、1-开启');
  55. $table->text('tls_provider')->nullable()->comment('V2Ray节点的TLS提供商授权信息');
  56. $table->dateTime('created_at')->comment('创建时间');
  57. $table->dateTime('updated_at')->comment('最后更新时间');
  58. });
  59. }
  60. /**
  61. * Reverse the migrations.
  62. *
  63. * @return void
  64. */
  65. public function down()
  66. {
  67. Schema::dropIfExists('ss_node');
  68. }
  69. }