seed bonus add log etc

This commit is contained in:
xiaomlove
2025-09-08 03:05:55 +07:00
parent ae08039323
commit 60b5aba518
53 changed files with 720 additions and 131 deletions

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('require_seed_torrents', function (Blueprint $table) {
$table->id();
$table->integer('torrent_id')->unique();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('require_seed_torrents');
}
};

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('user_require_seed_torrents', function (Blueprint $table) {
$table->id();
$table->integer('user_id');
$table->integer('torrent_id')->index();
$table->bigInteger('seed_time_begin');
$table->bigInteger('uploaded_begin');
$table->dateTime('last_settlement_at')->nullable()->index();
$table->timestamps();
$table->unique(['user_id', 'torrent_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('user_require_seed_torrents');
}
};

View File

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

View File

@@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('hit_and_runs', function (Blueprint $table) {
$table->bigInteger('leech_time_no_seeder')->default(0);
$table->bigInteger('leech_time_no_seeder_begin')->default(0);
});
}
@@ -22,7 +22,7 @@ return new class extends Migration
public function down(): void
{
Schema::table('hit_and_runs', function (Blueprint $table) {
$table->dropColumn('leech_time_no_seeder');
$table->dropColumn('leech_time_no_seeder_begin');
});
}
};

View File

@@ -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.
*/
public function up(): void
{
Schema::table('torrents', function (Blueprint $table) {
$table->index('added');
$table->index(['promotion_until', 'promotion_time_type']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('torrents', function (Blueprint $table) {
//
});
}
};