<?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('users', function (Blueprint $table) {
            // Privacy Settings
            $table->string('profile_visibility')->default('public');
            $table->string('display_name_format')->default('full_name'); 
            $table->boolean('include_in_stats')->default(true);
            $table->boolean('show_salary_to_connections')->default(true);
            $table->boolean('allow_comparison_requests')->default(false);
            $table->boolean('show_activity_to_connections')->default(true);
            $table->boolean('show_online_status')->default(true);

            // Notification Preferences
            $table->boolean('product_updates')->default(true);
            $table->boolean('weekly_reports')->default(true);
            $table->boolean('marketing_emails')->default(false);
            $table->boolean('notify_messages')->default(true);
            $table->boolean('notify_connections')->default(true);
            $table->boolean('notify_activity')->default(true);
            $table->boolean('push_messages')->default(true);
            $table->boolean('push_alerts')->default(true);

            // Preferences
            $table->string('language')->default('en_US');
            $table->string('theme')->default('light');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn([
                'profile_visibility',
                'display_name_format',
                'include_in_stats',
                'show_salary_to_connections',
                'allow_comparison_requests',
                'show_activity_to_connections',
                'show_online_status',
                'product_updates',
                'weekly_reports',
                'marketing_emails',
                'notify_messages',
                'notify_connections',
                'notify_activity',
                'push_messages',
                'push_alerts',
                'language',
                'theme'
            ]);
        });
    }
};
