<?php

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

return new class extends Migration
{
    public function up(): void
    {
        DB::table('media')
            ->where('model_type', 'App\\Models\\Folder')
            ->update(['model_type' => 'App\\Models\\Declaration']);

        DB::table('activity_log')
            ->where('subject_type', 'App\\Models\\Folder')
            ->update(['subject_type' => 'App\\Models\\Declaration']);
    }

    public function down(): void
    {
        DB::table('media')
            ->where('model_type', 'App\\Models\\Declaration')
            ->update(['model_type' => 'App\\Models\\Folder']);

        DB::table('activity_log')
            ->where('subject_type', 'App\\Models\\Declaration')
            ->update(['subject_type' => 'App\\Models\\Folder']);
    }
};
