<?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('organizations', function (Blueprint $t) {
            $t->boolean('public_page_enabled')->default(true)->after('is_active');
            $t->boolean('show_in_main_menu')->default(true)->after('public_page_enabled');
            $t->boolean('aggregate_news')->default(true)->after('show_in_main_menu');
            $t->boolean('aggregate_events')->default(true)->after('aggregate_news');
            $t->boolean('aggregate_programs')->default(true)->after('aggregate_events');
            $t->boolean('aggregate_gallery')->default(false)->after('aggregate_programs');
            $t->boolean('include_in_statistics')->default(true)->after('aggregate_gallery');
            $t->boolean('include_in_reports')->default(true)->after('include_in_statistics');
            $t->unsignedInteger('sort_order')->default(0)->after('include_in_reports');
            $t->json('settings')->nullable()->after('sort_order');
        });
    }
    public function down(): void {
        Schema::table('organizations', function (Blueprint $t) {
            $t->dropColumn(['public_page_enabled','show_in_main_menu','aggregate_news','aggregate_events','aggregate_programs','aggregate_gallery','include_in_statistics','include_in_reports','sort_order','settings']);
        });
    }
};
