<?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('products', function (Blueprint $table) {
            $table->dropColumn([
                'over_usage_billing',
                'over_usage_disk_limit',
                'over_usage_bandwith_limit',
                'over_usage_disk_price_per_gb',
                'over_usage_bandwith_price_per_gb',
            ]);
        });
    }

    public function down(): void
    {
        Schema::table('products', function (Blueprint $table) {
            $table->boolean('over_usage_billing')->default(false);
            $table->integer('over_usage_disk_limit')->nullable();
            $table->integer('over_usage_bandwith_limit')->nullable();
            $table->decimal('over_usage_disk_price_per_gb', 8, 2)->nullable();
            $table->decimal('over_usage_bandwith_price_per_gb', 8, 2)->nullable();
        });
    }
};
