Skip to content

Commit

Permalink
change torrent table info_hash nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Oct 13, 2024
1 parent 2750059 commit 6187789
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Console/Commands/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ public function __construct()
*/
public function handle()
{
$ip = "116.77.75.254";
$this->info(inet_pton($ip));
$ip = "44,
55,
444,65 5 32";
$result = preg_split("/[\r\n\s,,]+/", trim($ip));
dd($result);
}

}
Original file line number Diff line number Diff line change
@@ -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()
{
//
}
};

0 comments on commit 6187789

Please sign in to comment.