<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        DB::table('content_versions')
            ->update(['object_type' => DB::raw("CONCAT('App\\\Models\\\', object_type)")]);
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        DB::table('content_versions')
            ->update(['object_type' => DB::raw("SUBSTRING(object_type, LENGTH('App\\\Models\\\') + 1)")]);
    }
};
