<?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->uuid('id')->primary();
            $table->string('entity_type')->default('ASSET');
            $table->bigInteger('created_time');
            $table->uuid('tenant_id');
            $table->uuid('customer_xid');
            $table->string('name');
            $table->string('type');
            $table->string('label')->nullable();
            $table->uuid('asset_profile_id');
            $table->uuid('external_id')->nullable();
            $table->integer('version')->default(1);
            $table->json('additional_info')->nullable();
            $table->timestamps();

             // $table->foreign('tenant_id')->references('id')->on('tenants');
            // $table->foreign('customer_id')->references('id')->on('customers');

        });
    }

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