<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('services', function (Blueprint $table) {
            $table->id();
            $table->string('cts_event_id')->unique();
            $table->string('title');
            $table->date('date')->index();
            $table->string('preacher_name')->nullable();
            $table->string('beamer_tech_name')->nullable();
            $table->timestamp('finalized_at')->nullable();
            $table->timestamp('last_synced_at');
            $table->json('cts_data');
            $table->timestamps();
        });
    }

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