<?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('user_subscribers', function (Blueprint $table) {
            $table->string('market_provider')->nullable()->after('purchase_token');
            $table->string('product_id')->nullable()->after('market_provider');
            $table->timestamp('purchased_at')->nullable()->after('product_id');
            $table->timestamp('last_verified_at')->nullable()->after('purchased_at');
        });
    }

    public function down(): void
    {
        Schema::table('user_subscribers', function (Blueprint $table) {
            $table->dropColumn([
                'market_provider',
                '1',
                'purchased_at',
                'last_verified_at',
            ]);
        });
    }
};
