<?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('contacts', function (Blueprint $table) {
            $table->uuid('id')->primary();

            // OWNER
            $table->foreignUuid('user_id')->constrained()->cascadeOnDelete();

            // BASIC
            $table->string('name');

            // OPTIONAL
            $table->string('email')->nullable();
            $table->string('phone')->nullable();

            // META
            $table->string('type')->nullable();
            // privat, kunde, arbeit etc.

            $table->text('notes')->nullable();
            $table->date('birthday')->nullable();
            // SYSTEM
            $table->timestamps();
        });
    }

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