init section

This commit is contained in:
xiaomlove
2022-09-06 20:45:29 +08:00
parent fb329f72cc
commit f68b88f754
16 changed files with 496 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
private static array $tables = [
'sources', 'media', 'standards', 'codecs', 'audiocodecs', 'teams', 'processings'
];
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
foreach (self::$tables as $table) {
Schema::table($table, function (Blueprint $table) {
$table->integer('mode')->default(0);
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
foreach (self::$tables as $table) {
Schema::table($table, function (Blueprint $table) {
$table->dropColumn('mode');
});
}
}
};

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('taxonomies', function (Blueprint $table) {
$table->id();
$table->integer('mode')->default(0);
$table->string('name');
$table->string('torrent_field');
$table->string('image')->nullable(true);
$table->string('class_name')->nullable(true);
$table->integer('priority')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('taxonomies');
}
};

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.
*
* @return void
*/
public function up()
{
Schema::table('searchbox', function (Blueprint $table) {
$table->string('section_name')->after('name')->default('');
$table->integer('is_default')->after('section_name')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('searchbox', function (Blueprint $table) {
$table->dropColumn('section_name', 'is_default');
});
}
};

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('searchbox', function (Blueprint $table) {
$table->json('extra')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('json', function (Blueprint $table) {
//
});
}
};