<?php

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

return new class extends Migration {
    public function up(): void
    {
        DB::table('deliveries')
            ->where('status', 'accepted')
            ->update(['status' => 'confirmed']);

        DB::table('deliveries')
            ->where('status', 'completed')
            ->update(['status' => 'delivered']);
    }

    public function down(): void
    {
        DB::table('deliveries')
            ->where('status', 'confirmed')
            ->update(['status' => 'accepted']);

        DB::table('deliveries')
            ->where('status', 'delivered')
            ->update(['status' => 'completed']);
    }
};
