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

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

            // CONTENT
            $table->string('title'); // "Zahnarzt"
            $table->text('description')->nullable();

            // TIMING
            $table->timestamp('remind_at');

            // STATUS
            $table->boolean('is_sent')->default(false);

            // OPTIONAL CONTEXT
            $table->string('type')->nullable();
            // z.B. event, shopping, note

            $table->uuid('reference_id')->nullable();
            // später z.B. event_id

            $table->timestamps();
        });
    }

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