<?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('store_product_targets', function (Blueprint $table) {
            $table->unsignedInteger('expected_rank_group')->nullable()->after('expected_url_contains');
            $table->string('expected_data_docid')->nullable()->after('expected_rank_group');
            $table->string('expected_product_id')->nullable()->after('expected_data_docid');
            $table->string('expected_gid')->nullable()->after('expected_product_id');
            $table->json('expected_shopping_url_contains')->nullable()->after('expected_gid');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('store_product_targets', function (Blueprint $table) {
            $table->dropColumn([
                'expected_rank_group',
                'expected_data_docid',
                'expected_product_id',
                'expected_gid',
                'expected_shopping_url_contains',
            ]);
        });
    }
};
