<?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('partnerships', function (Blueprint $table) {
            $table->id();
            $table->foreignId('workspace_id')->constrained()->cascadeOnDelete();
            $table->string('restaurant_name');
            $table->string('instagram_handle')->nullable();
            $table->string('instagram_url')->nullable();
            $table->string('status', 32)->default('contacted');
            $table->date('scheduled_date')->nullable();
            $table->string('scheduled_time')->nullable();
            $table->json('inclusions')->nullable();
            $table->unsignedInteger('guests')->nullable();
            $table->text('notes')->nullable();
            $table->string('location')->nullable();
            $table->string('post_url')->nullable();
            $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
            $table->foreignId('managed_by_restaurant')->nullable()->constrained('users')->nullOnDelete();
            $table->timestamps();
        });
    }

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