<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20260622173707 extends AbstractMigration
{
    public function getDescription(): string
    {
        return '';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('CREATE TABLE tenant_service_coverage (id INT AUTO_INCREMENT NOT NULL, uuid VARCHAR(36) NOT NULL, tenant_insurance_id INT NOT NULL, service_item_id INT NOT NULL, covered TINYINT NOT NULL, coverage_percent NUMERIC(5, 2) DEFAULT NULL, franchise_rials INT DEFAULT NULL, ceiling_rials INT DEFAULT NULL, updated_at INT NOT NULL, UNIQUE INDEX UNIQ_76431C8ED17F50A6 (uuid), INDEX idx_tsc_service (service_item_id), UNIQUE INDEX uniq_tenant_service_coverage (tenant_insurance_id, service_item_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
        $this->addSql('ALTER TABLE service_items ADD insurance_covered TINYINT NOT NULL, ADD insurance_price_rials INT DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('DROP TABLE tenant_service_coverage');
        $this->addSql('ALTER TABLE service_items DROP insurance_covered, DROP insurance_price_rials');
    }
}
