<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('company_branches', function (Blueprint $table) {
            $table->id();
            $table->string('code', 10)->nullable()->unique();
            $table->string('name', 30)->nullable();
            $table->string('continent', 30)->nullable()->default('Africa');
            $table->string('city', 50)->nullable();
            $table->string('address', 255)->nullable();
            $table->string('box', 50)->nullable();
            $table->string('tel', 50)->nullable();
            $table->string('phone', 50)->nullable();
            $table->string('em', 100)->nullable();
            $table->string('coi', 30)->nullable();
            $table->string('website', 50)->nullable();
            $table->longText('payment_details')->nullable();
            $table->boolean('status')->default(true);
            $table->boolean('deleted')->default(false);
            $table->string('deleted_by', 10)->nullable();
            $table->softDeletes();
            $table->string('created_by', 10)->nullable();
            $table->timestamps();
        });
    }

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