change torrent table info_hash nullable

This commit is contained in:
xiaomlove
2024-10-14 02:23:20 +08:00
parent 2750059bea
commit 61877894fe
2 changed files with 34 additions and 2 deletions
+5 -2
View File
@@ -100,8 +100,11 @@ class Test extends Command
*/ */
public function handle() public function handle()
{ {
$ip = "116.77.75.254"; $ip = "44,
$this->info(inet_pton($ip)); 55,
444,65 5 32";
$result = preg_split("/[\r\n\s,]+/", trim($ip));
dd($result);
} }
} }
@@ -0,0 +1,29 @@
<?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()
{
$sql = 'ALTER table torrents MODIFY column `info_hash` binary(20) DEFAULT NULL';
\Illuminate\Support\Facades\DB::statement($sql);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};