backfill element descriptions
This commit is contained in:
parent
72e4720787
commit
ca04884e88
1 changed files with 41 additions and 0 deletions
|
|
@ -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' => '']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue