<?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('company_registrations', function (Blueprint $table) {
            $table->dropColumn([
                'director_bvn_iv',
                'director_bvn_tag',
                'nin_number_iv',
                'nin_number_tag',
            ]);
        });

        Schema::table('company_registration_updates', function (Blueprint $table) {
            $table->dropColumn([
                'director_bvn_iv',
                'director_bvn_tag',
                'nin_number_iv',
                'nin_number_tag',
            ]);
        });

        Schema::table('employee_registrations', function (Blueprint $table) {
            $table->dropColumn([
                'bvn_iv',
                'bvn_tag',
                'nin_number_iv',
                'nin_number_tag',
            ]);
        });

        Schema::table('individual_registrations', function (Blueprint $table) {
            $table->dropColumn([
                'bvn_iv',
                'bvn_tag',
                'nin_number_iv',
                'nin_number_tag',
            ]);
        });
    }

    public function down(): void
    {
        Schema::table('company_registrations', function (Blueprint $table) {
            $table->string('director_bvn_iv', 64)->nullable();
            $table->string('director_bvn_tag', 64)->nullable();
            $table->string('nin_number_iv', 64)->nullable();
            $table->string('nin_number_tag', 64)->nullable();
        });

        Schema::table('company_registration_updates', function (Blueprint $table) {
            $table->string('director_bvn_iv', 64)->nullable();
            $table->string('director_bvn_tag', 64)->nullable();
            $table->string('nin_number_iv', 64)->nullable();
            $table->string('nin_number_tag', 64)->nullable();
        });

        Schema::table('employee_registrations', function (Blueprint $table) {
            $table->string('bvn_iv', 64)->nullable();
            $table->string('bvn_tag', 64)->nullable();
            $table->string('nin_number_iv', 64)->nullable();
            $table->string('nin_number_tag', 64)->nullable();
        });

        Schema::table('individual_registrations', function (Blueprint $table) {
            $table->string('bvn_iv', 64)->nullable();
            $table->string('bvn_tag', 64)->nullable();
            $table->string('nin_number_iv', 64)->nullable();
            $table->string('nin_number_tag', 64)->nullable();
        });
    }
};
