<?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('discovery_feedback_daily_metrics', function (Blueprint $table): void {
            $table->unsignedInteger('hidden_artworks')->default(0)->after('downloads');
            $table->unsignedInteger('disliked_tags')->default(0)->after('hidden_artworks');
            $table->unsignedInteger('undo_hidden_artworks')->default(0)->after('disliked_tags');
            $table->unsignedInteger('undo_disliked_tags')->default(0)->after('undo_hidden_artworks');
            $table->unsignedInteger('negative_feedback_actions')->default(0)->after('feedback_actions');
            $table->unsignedInteger('undo_actions')->default(0)->after('negative_feedback_actions');
        });
    }

    public function down(): void
    {
        Schema::table('discovery_feedback_daily_metrics', function (Blueprint $table): void {
            $table->dropColumn([
                'hidden_artworks',
                'disliked_tags',
                'undo_hidden_artworks',
                'undo_disliked_tags',
                'negative_feedback_actions',
                'undo_actions',
            ]);
        });
    }
};
