<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Service kind (outpatient/inpatient) a service item belongs to. The insurance
 * coverage percentage is resolved per this value.
 */
final class Version20260725121548 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add service_items.service_category (defaults every existing row to outpatient)';
    }

    public function up(Schema $schema): void
    {
        $this->addSql("ALTER TABLE service_items ADD service_category VARCHAR(30) DEFAULT 'outpatient' NOT NULL");
        $this->addSql("UPDATE service_items SET service_category = 'outpatient' WHERE service_category = ''");
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE service_items DROP service_category');
    }
}
