<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    public function up(): void
    {
        DB::statement("ALTER TABLE website_settings ALTER COLUMN is_published SET DEFAULT true");
        DB::table('website_settings')->where('is_published', false)->update(['is_published' => true]);
    }

    public function down(): void
    {
        DB::statement("ALTER TABLE website_settings ALTER COLUMN is_published SET DEFAULT false");
    }
};
