[H&R] basically

This commit is contained in:
xiaomlove
2021-06-21 02:01:26 +08:00
parent 45aba84111
commit d2a8f1a1a6
39 changed files with 966 additions and 74 deletions
@@ -15,13 +15,14 @@ class CreateHitAndRunsTable extends Migration
{
Schema::create('hit_and_runs', function (Blueprint $table) {
$table->id();
$table->integer('uid')->index();
$table->integer('peer_id')->unique();
$table->integer('torrent_id')->index();
$table->integer('uid');
$table->integer('torrent_id');
$table->integer('snatched_id')->unique();
$table->integer('status')->default(1);
$table->string('comment')->default('');
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
$table->unique(['uid', 'torrent_id']);
});
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddHrToTorrentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('torrents', function (Blueprint $table) {
$table->tinyInteger('hr')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('torrents', function (Blueprint $table) {
$table->dropColumn('hr');
});
}
}
@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBonusLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bonus_logs', function (Blueprint $table) {
$table->id();
$table->integer('business_type')->default(0);
$table->integer('uid')->index();
$table->integer('old_total_value');
$table->integer('value');
$table->integer('new_total_value');
$table->string('comment')->nullable();
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bonus_logs');
}
}