add set media migration

This commit is contained in:
Yisroel Baum 2026-05-25 20:46:54 +03:00
parent fa8efd765f
commit 0aeeed6f2e
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 33 additions and 2 deletions

View file

@ -11,8 +11,6 @@ return new class extends Migration
Schema::create('sets', function (Blueprint $table) { Schema::create('sets', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name'); $table->string('name');
$table->text('description');
$table->string('icon_image_url');
}); });
} }

View file

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('sets', function (Blueprint $table) {
$table->text('description')->default('');
$table->string('icon_image_url')->default('');
});
DB::table('sets')
->where('name', 'Baderech HaAvodah')
->update([
'description' => 'Baderech HaAvodah is a way of living - '
. 'a structured path for inner and outer growth, '
. 'spiritual refinement, and personal development.',
'icon_image_url' => '/assets/baderech-haavodah-icon.svg',
]);
}
public function down(): void
{
Schema::table('sets', function (Blueprint $table) {
$table->dropColumn(['description', 'icon_image_url']);
});
}
};