mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
5517d4061e
* feat(admin): add settings to override config values * style: fix StyleCI findings * refactor: use model constants in migration
38 lines
810 B
PHP
38 lines
810 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\Admin\Setting;
|
|
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(): void
|
|
{
|
|
if (! Schema::hasTable(Setting::TABLE)) {
|
|
Schema::create(Setting::TABLE, function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string(Setting::ATTRIBUTE_KEY)->index();
|
|
$table->text(Setting::ATTRIBUTE_VALUE);
|
|
});
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists(Setting::TABLE);
|
|
}
|
|
};
|