<?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('assets', function (Blueprint $table) {
            $table->id();
            $table->string('name', 100);
            $table->string('code', 45);
            $table->integer('company_id');
            $table->enum('status', ['doing', 'done', 'closed'])->default('doing');
            $table->integer('owner');
            $table->integer('group_id')->unsigned();
            $table->string("address", 255)->nullable();
            $table->string("geo_address_code")->nullable();
            $table->decimal("latitude", 10, 6)->nullable();
            $table->decimal("longitude", 10, 6)->nullable();
            $table->text("description")->nullable();
            $table->enum("acl", ['private', 'custom'])->default('private');
            $table->string('whitelist', 255)->nullable();
            $table->integer("created_by")->nullable();
            $table->timestamps();
        });
    }

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