<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        DB::table('bajas')->updateOrInsert(
            ['id' => 1],
            [
                'descripcion' => 'Activo',
                'created_at' => now(),
                'updated_at' => now(),
            ]
        );

        DB::table('bajas')->updateOrInsert(
            ['id' => 2],
            [
                'descripcion' => 'Baja',
                'created_at' => now(),
                'updated_at' => now(),
            ]
        );

        DB::statement('ALTER TABLE profesionales MODIFY baja_id BIGINT UNSIGNED NOT NULL DEFAULT 1');
        DB::statement('ALTER TABLE clientes MODIFY baja_id BIGINT UNSIGNED NOT NULL DEFAULT 1');
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        DB::statement('ALTER TABLE profesionales MODIFY baja_id BIGINT UNSIGNED NOT NULL');
        DB::statement('ALTER TABLE clientes MODIFY baja_id BIGINT UNSIGNED NOT NULL');
    }
};