plugin management + user tables and torrents table text column migrate

This commit is contained in:
xiaomlove
2025-01-19 14:37:00 +08:00
parent 0f88ab8d82
commit 403a9447a9
66 changed files with 1432 additions and 786 deletions

View File

@@ -0,0 +1,31 @@
<?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('torrent_extras', function (Blueprint $table) {
$table->id();
$table->integer('torrent_id')->unique();
$table->mediumText('descr');
$table->text('media_info')->nullable();
$table->binary('nfo')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('torrent_extras');
}
};

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::create('user_modify_logs', function (Blueprint $table) {
$table->id();
$table->integer('user_id')->index();
$table->text('content');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('user_modify_logs');
}
};

View File

@@ -0,0 +1,31 @@
<?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('users', function (Blueprint $table) {
if (Schema::hasColumn('users', 'modcomment')) {
$table->dropColumn('modcomment');
}
if (Schema::hasColumn('users', 'bonuscomment')) {
$table->dropColumn("bonuscomment");
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@@ -0,0 +1,30 @@
<?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) {
foreach (["ori_descr", "descr", "nfo", "technical_info", "pt_gen"] as $field) {
if (Schema::hasColumn('torrents', $field)) {
$table->dropColumn($field);
}
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};