<?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::table('forms', function (Blueprint $table) {
            $table->string('success_type')->default('message')->after('fields');
            $table->text('success_message')->nullable()->after('success_type');
            $table->string('success_redirect_url', 500)->nullable()->after('success_message');
        });
    }

    public function down(): void
    {
        Schema::table('forms', function (Blueprint $table) {
            $table->dropColumn(['success_type', 'success_message', 'success_redirect_url']);
        });
    }
};
