<?php
// database/migrations/[timestamp]_add_based_on_to_recommendations_table.php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('recommendations', function (Blueprint $table) {
            $table->string('based_on')->nullable()->after('category');
            $table->float('confidence')->nullable()->after('based_on');
        });
    }

    public function down(): void
    {
        Schema::table('recommendations', function (Blueprint $table) {
            $table->dropColumn(['based_on', 'confidence']);
        });
    }
};