<?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
    {
        if (!Schema::hasColumn('company_financial_logs', 'report_period')) {
            Schema::table('company_financial_logs', function (Blueprint $table) {
                $table->enum('report_period', ['monthly','quarterly','annual'])
                      ->default('monthly')
                      ->after('country');
            });
        }
    }

    public function down(): void
    {
        Schema::table('company_financial_logs', function (Blueprint $table) {
            $table->dropColumn('report_period');
        });
    }
};
