<?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('company_registrations', function (Blueprint $table) {
            // Add CAC document path
            $table->string('cac_document_path')->nullable()->after('director_identity_cards_path');

            // Remove signature mandate and company seal
            $table->dropColumn(['signature_mandate_path', 'company_seal_image_path']);
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('company_registrations', function (Blueprint $table) {
            // Add back signature mandate and company seal
            $table->string('signature_mandate_path')->nullable();
            $table->string('company_seal_image_path')->nullable();

            // Remove CAC document
            $table->dropColumn('cac_document_path');
        });
    }
};
