<?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('timeseries_alert_messages', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->unsignedBigInteger('timeseries_key_master_xid');
            $table->decimal('min_value', 10, 2)->nullable();
            $table->decimal('max_value', 10, 2)->nullable();
            $table->string('color_code', 7)->nullable();
            $table->text('alert_msg')->nullable();
            $table->timestamps();
            $table->softDeletes();

            // $table->foreign('timeseries_key_master_xid')->references('id')->on('timeseries_key_master')->onDelete('cascade');

        });
    }

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