<?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::create('companies', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->cascadeOnDelete();
            $table->string('name', 100)->index();
            $table->string('email', 254)->index();
            $table->text('address');
            $table->string('director_name', 150);
            $table->string('director_nik', 16);
            $table->string('deed_incorporation', 150);
            $table->string('trade_license', 150);
            $table->string('tax_id_number', 150);
            $table->string('taxable_enterprise', 150);
            $table->string('annual_tax_return', 150);
            $table->string('domicile_certificate', 150);
            $table->string('profile', 150);
            $table->timestamp('created_at')->useCurrent();
            $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('companies');
    }
};
