<?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::table('company_settings', function (Blueprint $table) {
            $table->string('facebook_client_id')->nullable()->after('apple_auth_enabled');
            $table->string('facebook_client_secret')->nullable()->after('facebook_client_id');
            $table->boolean('facebook_auth_enabled')->default(false)->after('facebook_client_secret');
            $table->string('recaptcha_site_key')->nullable()->after('facebook_auth_enabled');
            $table->string('recaptcha_secret_key')->nullable()->after('recaptcha_site_key');
            $table->boolean('recaptcha_enabled')->default(false)->after('recaptcha_secret_key');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('company_settings', function (Blueprint $table) {
            $table->dropColumn([
                'facebook_client_id',
                'facebook_client_secret',
                'facebook_auth_enabled',
                'recaptcha_site_key',
                'recaptcha_secret_key',
                'recaptcha_enabled',
            ]);
        });
    }
};
