<?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('google_client_id')->nullable()->after('company_notes');
            $table->string('google_client_secret')->nullable()->after('google_client_id');
            $table->string('apple_client_id')->nullable()->after('google_client_secret');
            $table->string('apple_client_secret')->nullable()->after('apple_client_id');
            $table->boolean('google_auth_enabled')->default(false)->after('apple_client_secret');
            $table->boolean('apple_auth_enabled')->default(false)->after('google_auth_enabled');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('company_settings', function (Blueprint $table) {
            $table->dropColumn([
                'google_client_id',
                'google_client_secret',
                'apple_client_id',
                'apple_client_secret',
                'google_auth_enabled',
                'apple_auth_enabled',
            ]);
        });
    }
};
