<?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('companies', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('company_type_id');
            $table->foreign('company_type_id')->references('id')->on('company_types')->onDelete('cascade');
            $table->string("name", 50);
            $table->string("name_en", 50);
            $table->longText("address"); 
            $table->string("district");
            $table->string("sub_province");
            $table->string("province");
            $table->string("postcode");
            $table->string("contry_code");
            $table->string("phone");
            $table->string("fax");
            $table->string("tax",13);
            $table->string("branch");
            $table->string("tax_incentive");
            $table->timestamps();
        });
    }

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