<?php

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

return new class extends Migration
{
    public function up(): void
    {
        DB::table('findings')
            ->where('finding_type', 'drift')
            ->where(static function (Builder $query): void {
                $query
                    ->whereNull('source')
                    ->orWhere('source', '!=', 'baseline.compare');
            })
            ->delete();
    }

    public function down(): void {}
};
