mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-06 19:20:25 -05:00
update: migrations missing imports
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use App\Models\History;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Peer;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
|
||||
@@ -52,6 +52,7 @@ use App\Models\Wish;
|
||||
use Assada\Achievements\Model\AchievementProgress;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
|
||||
@@ -18,6 +18,7 @@ use App\Models\TorrentFile;
|
||||
use App\Models\Warning;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
|
||||
@@ -13,29 +13,12 @@ return new class () extends Migration {
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Peer::query()
|
||||
->update([
|
||||
'ip' => DB::raw('INET6_ATON(`ip`)'),
|
||||
'peer_id' => DB::raw('UNHEX(`peer_id`)'),
|
||||
]);
|
||||
|
||||
Peer::query()
|
||||
->whereNull('peer_id')
|
||||
->orWhereNull('ip')
|
||||
->orWhereNull('port')
|
||||
->orWhereNull('agent')
|
||||
->orWhereNull('uploaded')
|
||||
->orWhereNull('downloaded')
|
||||
->orWhereNull('left')
|
||||
->orWhereNull('seeder')
|
||||
->orWhereNull('torrent_id')
|
||||
->orWhereNull('user_id')
|
||||
->delete();
|
||||
Peer::truncate();
|
||||
|
||||
Schema::disableForeignKeyConstraints();
|
||||
|
||||
Schema::table('peers', function (Blueprint $table) {
|
||||
$table->dropColumn(['md5_peer_id', 'info_hash', 'connectable']);
|
||||
$table->dropColumn(['md5_peer_id', 'info_hash']);
|
||||
$table->unsignedSmallInteger('port')->nullable(false)->change();
|
||||
$table->string('agent', 64)->nullable(false)->change();
|
||||
$table->unsignedBigInteger('uploaded')->nullable(false)->change();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use App\Models\History;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use App\Models\TorrentRequest;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
|
||||
Reference in New Issue
Block a user