<?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('subscriptions', function (Blueprint $table) {
            // Make Stripe-specific fields nullable for unified payment system
            $table->string('stripe_id')->nullable()->change();
            $table->string('stripe_status')->nullable()->change();
            $table->string('stripe_price')->nullable()->change();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('subscriptions', function (Blueprint $table) {
            // Revert Stripe fields back to NOT NULL
            $table->string('stripe_id')->nullable(false)->change();
            $table->string('stripe_status')->nullable(false)->change();
            $table->string('stripe_price')->nullable(false)->change();
        });
    }
};
