<?php

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

class CreateCompaniesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('companies', function (Blueprint $table) {
            $table->id();
			$table->char('uuid', 36)->index()->unique();
			$table->integer('logo_id')->nullable();
            $table->string('name')->nullable();
			$table->string('full_name', 500)->nullable();
			$table->string('inn')->index()->unique();
			$table->string('kpp', 20)->nullable();
			$table->string('ogrn', 20)->nullable();
			$table->string('okpo', 20)->nullable();
			$table->string('okved', 20)->nullable();
			$table->string('okato', 20)->nullable();
			$table->timestamp('tax_registration_date')->nullable();
			$table->boolean('is_main')->index()->default(0);
            $table->timestamps();
			$table->softDeletes();
        });
    }

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