add torrent pieces hash

This commit is contained in:
xiaomlove
2023-07-26 03:29:50 +08:00
parent 68b391785b
commit 47346c4844
8 changed files with 193 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('torrents', function (Blueprint $table) {
$table->char("pieces_hash", 40)->default("")->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('torrents', function (Blueprint $table) {
$table->dropColumn("pieces_hash");
});
}
};