<?php

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

class CreateLeadNotesTable extends Migration
{
    public function up()
    {
        Schema::create('lead_notes', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('lead_id');
            $table->string('added_by')->default('Admin');   // name string
            $table->string('avatar_color')->default('#1a73e8');
            $table->enum('via', ['Phone Call', 'WhatsApp', 'Email', 'Meeting', 'Walk-in', 'Note'])->default('Note');
            $table->text('note');
            $table->timestamps();

            $table->foreign('lead_id')->references('id')->on('leads')->onDelete('cascade');
        });
    }

    public function down()
    {
        Schema::dropIfExists('lead_notes');
    }
}