<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
    public function up(): void
    {
        $skills = [
            ['name' => 'Ironing', 'created_at' => now(), 'updated_at' => now()],
            ['name' => 'Car Washing', 'created_at' => now(), 'updated_at' => now()],
            ['name' => 'Pet Sitting', 'created_at' => now(), 'updated_at' => now()],
        ];

        foreach ($skills as $skill) {
            DB::table('skills')->updateOrInsert(['name' => $skill['name']], $skill);
        }
    }

    public function down(): void
    {
        DB::table('skills')->whereIn('name', ['Ironing', 'Car Washing', 'Pet Sitting'])->delete();
    }
};
