move into sonardesk

This commit is contained in:
Mark Gregory
2026-10-12 16:29:40 +01:00
parent dd1f144908
commit 663e311724
10 changed files with 60 additions and 19 deletions
@@ -3,6 +3,16 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void { Schema::table('download_products',function(Blueprint $table){$table->longText('release_notes')->nullable();$table->text('minimum_system')->nullable();$table->integer('sort_order')->default(0);}); }
public function down(): void {Schema::table('download_products',function(Blueprint $table){$table->dropColumn(['release_notes','minimum_system','sort_order']);});}
public function up(): void {
if (!Schema::hasTable('download_products')) return;
foreach (['release_notes' => 'longText', 'minimum_system' => 'text', 'sort_order' => 'integer'] as $column => $type) {
if (!Schema::hasColumn('download_products', $column)) {
Schema::table('download_products', function (Blueprint $table) use ($column, $type) {
$definition = $table->{$type}($column);
if ($column === 'sort_order') $definition->default(0); else $definition->nullable();
});
}
}
}
public function down(): void { /* Preserve existing download metadata. */ }
};
@@ -0,0 +1,15 @@
<?php
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('download_products')) return;
foreach (['release_notes'=>'longText','minimum_system'=>'text','sort_order'=>'integer'] as $column=>$type) {
if (!Schema::hasColumn('download_products',$column)) Schema::table('download_products',function(Blueprint $table) use ($column,$type) {
$c=$table->{$type}($column); if ($column==='sort_order') $c->default(0); else $c->nullable();
});
}
}
public function down(): void { /* Keep uploaded download metadata intact. */ }
};