<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('price_observations', function (Blueprint $table) {
            $table->text('shopping_url')->nullable()->after('original_url');
            $table->unsignedInteger('rank_group')->nullable()->after('position');
            $table->unsignedInteger('rank_absolute')->nullable()->after('rank_group');
            $table->string('data_docid')->nullable()->after('rank_absolute');
            $table->string('product_id')->nullable()->after('data_docid');
            $table->string('gid')->nullable()->after('product_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('price_observations', function (Blueprint $table) {
            $table->dropColumn([
                'shopping_url',
                'rank_group',
                'rank_absolute',
                'data_docid',
                'product_id',
                'gid',
            ]);
        });
    }
};
