mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
clean: remove encode model (#952)
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\Auth\User;
|
||||
use App\Models\User\Encode;
|
||||
use App\Models\Wiki\Video;
|
||||
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
|
||||
{
|
||||
if (! Schema::hasTable(Encode::TABLE)) {
|
||||
Schema::create(Encode::TABLE, function (Blueprint $table) {
|
||||
$table->id(Encode::ATTRIBUTE_ID);
|
||||
$table->unsignedBigInteger(Encode::ATTRIBUTE_USER);
|
||||
$table->foreign(Encode::ATTRIBUTE_USER)->references(User::ATTRIBUTE_ID)->on(User::TABLE)->cascadeOnDelete();
|
||||
$table->unsignedBigInteger(Encode::ATTRIBUTE_VIDEO);
|
||||
$table->foreign(Encode::ATTRIBUTE_VIDEO)->references(Video::ATTRIBUTE_ID)->on(Video::TABLE)->cascadeOnDelete();
|
||||
$table->timestamps(6);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists(Encode::TABLE);
|
||||
}
|
||||
};
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Models\User\Encode;
|
||||
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
|
||||
{
|
||||
if (! Schema::hasColumn(Encode::TABLE, Encode::ATTRIBUTE_TYPE)) {
|
||||
Schema::table(Encode::TABLE, function (Blueprint $table) {
|
||||
$table->integer(Encode::ATTRIBUTE_TYPE)->after(Encode::ATTRIBUTE_VIDEO);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if (Schema::hasColumn(Encode::TABLE, Encode::ATTRIBUTE_TYPE)) {
|
||||
Schema::table(Encode::TABLE, function (Blueprint $table) {
|
||||
$table->dropColumn(Encode::ATTRIBUTE_TYPE);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user