<?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
    {
        // Pointer round-robin: index campaign (urut id) yg terakhir dilayani
        // oleh rotator kategori ini. Naik 1 per tayang, wrap ke 0 di ujung.
        Schema::table('kategoris', function (Blueprint $table) {
            $table->unsignedBigInteger('rotation_pointer')->default(0)->after('viewed');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('kategoris', function (Blueprint $table) {
            $table->dropColumn('rotation_pointer');
        });
    }
};
