<?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('subscriptions', function (Blueprint $table): void {
            $table->timestamp('current_period_start')->nullable()->after('quantity');
            $table->timestamp('current_period_end')->nullable()->after('current_period_start');
            $table->json('stripe_data')->nullable()->after('current_period_end');
        });
    }

    public function down(): void
    {
        Schema::table('subscriptions', function (Blueprint $table): void {
            $table->dropColumn(['current_period_start', 'current_period_end', 'stripe_data']);
        });
    }
};
