<?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('packages', function (Blueprint $table) {
            $table->string('paddle_sync_status', 50)
                ->nullable()
                ->after('paddle_price_id');
            $table->timestamp('paddle_synced_at')
                ->nullable()
                ->after('paddle_sync_status');
            $table->json('paddle_snapshot')
                ->nullable()
                ->after('paddle_synced_at');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('packages', function (Blueprint $table) {
            $table->dropColumn(['paddle_sync_status', 'paddle_synced_at', 'paddle_snapshot']);
        });
    }
};
