added description

This commit is contained in:
Mark Gregory
2026-07-01 11:09:08 +01:00
parent 4413ce6dcc
commit f3cd80e38d
152 changed files with 349 additions and 113 deletions
@@ -21,6 +21,8 @@ return new class extends Migration
$table->id();
$table->string('module')->unique();
$table->boolean('enabled')->default(true);
$table->text('description')->nullable();
$table->unsignedInteger('sort_order')->default(0);
$table->timestamps();
});
}
@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
if (! Schema::hasTable('module_statuses')) {
return;
}
Schema::table('module_statuses', function (Blueprint $table): void {
if (! Schema::hasColumn('module_statuses', 'description')) {
$table->text('description')->nullable()->after('enabled');
}
if (! Schema::hasColumn('module_statuses', 'sort_order')) {
$table->unsignedInteger('sort_order')->default(0)->after('description');
}
});
}
public function down(): void
{
if (! Schema::hasTable('module_statuses')) {
return;
}
Schema::table('module_statuses', function (Blueprint $table): void {
if (Schema::hasColumn('module_statuses', 'sort_order')) {
$table->dropColumn('sort_order');
}
if (Schema::hasColumn('module_statuses', 'description')) {
$table->dropColumn('description');
}
});
}
};