new updates

This commit is contained in:
Mark Gregory
2026-07-01 11:17:58 +01:00
parent c2ce6d9ccb
commit cd7226cfa5
8 changed files with 124 additions and 26 deletions
@@ -22,6 +22,7 @@ return new class extends Migration
$table->string('module')->unique();
$table->boolean('enabled')->default(true);
$table->text('description')->nullable();
$table->string('version')->nullable();
$table->unsignedInteger('sort_order')->default(0);
$table->timestamps();
});
@@ -19,8 +19,12 @@ return new class extends Migration
$table->text('description')->nullable()->after('enabled');
}
if (! Schema::hasColumn('module_statuses', 'version')) {
$table->string('version')->nullable()->after('description');
}
if (! Schema::hasColumn('module_statuses', 'sort_order')) {
$table->unsignedInteger('sort_order')->default(0)->after('description');
$table->unsignedInteger('sort_order')->default(0)->after('version');
}
});
}
@@ -36,6 +40,10 @@ return new class extends Migration
$table->dropColumn('sort_order');
}
if (Schema::hasColumn('module_statuses', 'version')) {
$table->dropColumn('version');
}
if (Schema::hasColumn('module_statuses', 'description')) {
$table->dropColumn('description');
}
@@ -0,0 +1,36 @@
<?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', 'version')) {
$table->string('version')->nullable()->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', 'version')) {
$table->dropColumn('version');
}
});
}
};