<?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('survey_responses', function (Blueprint $table) {
            $table->id();
            $table->foreignId('lead_id')->nullable()->constrained('leads')->nullOnDelete();
            $table->string('email')->nullable();
            $table->string('biz_name')->nullable();
            $table->string('biz_type', 50)->nullable();
            $table->string('biz_age', 50)->nullable();
            $table->string('revenue', 50)->nullable();
            $table->json('channels')->nullable();
            $table->string('pain_point', 100)->nullable();
            $table->string('persona_gender', 50)->nullable();
            $table->string('persona_age', 50)->nullable();
            $table->string('persona_income', 50)->nullable();
            $table->string('persona_time', 50)->nullable();
            $table->string('persona_why', 100)->nullable();
            $table->json('brand_words')->nullable();
            $table->string('brand_voice', 50)->nullable();
            $table->string('brand_color', 50)->nullable();
            $table->text('brand_statement')->nullable();
            $table->boolean('has_time')->nullable();
            $table->string('has_team', 50)->nullable();
            $table->string('marketing_budget', 50)->nullable();
            $table->string('recommended_tier', 50)->nullable();
            $table->json('raw_responses')->nullable();
            $table->timestamp('completed_at')->nullable();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('survey_responses'); }
};
