tracker user update use variable instead of properity

This commit is contained in:
xiaomlove
2022-04-21 17:54:26 +08:00
parent a33394c2aa
commit e306b1f6ed
3 changed files with 22 additions and 24 deletions
@@ -19,7 +19,7 @@ class CreatePeersTable extends Migration
Schema::create('peers', function (Blueprint $table) {
$table->increments('id');
$table->unsignedMediumInteger('torrent')->default(0);
$table->char('peer_id', 20)->charset('binary');
$table->char('peer_id', 20)->charset('binary')->index();
$table->string('ip', 64)->default('');
$table->unsignedSmallInteger('port')->default(0);
$table->unsignedBigInteger('uploaded')->default(0);
@@ -30,13 +30,13 @@ class CreatePeersTable extends Migration
$table->dateTime('last_action')->nullable();
$table->dateTime('prev_action')->nullable();
$table->enum('connectable', ['yes', 'no'])->default('yes');
$table->unsignedMediumInteger('userid')->default(0)->index('userid');
$table->unsignedMediumInteger('userid')->default(0)->index();
$table->string('agent', 60)->default('');
$table->unsignedInteger('finishedat')->default(0);
$table->unsignedBigInteger('downloadoffset')->default(0);
$table->unsignedBigInteger('uploadoffset')->default(0);
$table->char('passkey', 32)->default('');
$table->unique(['torrent', 'peer_id']);
$table->index(['torrent', 'peer_id']);
});
}
@@ -28,7 +28,7 @@ return new class extends Migration
}
Schema::table($tableName, function (Blueprint $table) {
$table->unique(['torrent', 'peer_id']);
$table->index(['torrent', 'peer_id']);
$table->index('peer_id');
});
}