backfill element descriptions

This commit is contained in:
Yisroel Baum 2026-05-26 21:13:39 +03:00
parent 72e4720787
commit ca04884e88
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
public function up(): void
{
$descriptionsByTitle = [
'Baderech HaAvodah' => 'Baderech HaAvodah is a way of living - '
. 'a structured path for inner and outer growth, '
. 'spiritual refinement, and personal development.',
'Avodah Foundations' => 'Core foundations for building a steady '
. 'avodah practice.',
'Daily Practice' => 'Practical steps for consistent daily growth.',
];
foreach ($descriptionsByTitle as $title => $description) {
DB::table('elements')
->where('title', $title)
->where('description', '')
->update(['description' => $description]);
}
}
public function down(): void
{
$titles = [
'Baderech HaAvodah',
'Avodah Foundations',
'Daily Practice',
];
foreach ($titles as $title) {
DB::table('elements')
->where('title', $title)
->update(['description' => '']);
}
}
};